Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752479AbbDUJqx (ORCPT ); Tue, 21 Apr 2015 05:46:53 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:34102 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbbDUJqu (ORCPT ); Tue, 21 Apr 2015 05:46:50 -0400 MIME-Version: 1.0 In-Reply-To: <20150420203703.GG14892@sirena.org.uk> References: <1429538005-1985-1-git-send-email-bert@biot.com> <20150420203703.GG14892@sirena.org.uk> Date: Tue, 21 Apr 2015 11:46:49 +0200 X-Google-Sender-Auth: TtZbK1R7qBVux4tR55S8L2vxD3Q Message-ID: Subject: Re: [PATCH] spi: rb4xx: Fix set_cs logic. From: Geert Uytterhoeven To: Mark Brown Cc: Bert Vermeulen , linux-spi , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1983 Lines: 51 On Mon, Apr 20, 2015 at 10:37 PM, Mark Brown wrote: > On Mon, Apr 20, 2015 at 03:53:25PM +0200, Bert Vermeulen wrote: >> As it turns out, the set_cs() enable parameter refers to the logic level >> on the CS pin, not the state of chip selection. > >> This broke functionality of the LEDs behind the CPLD, or at least delayed >> the commands until another one came in to toggle CS. > > No, the enable parameter *should* refer to chip select assertion (see > how we handle GPIO chip selects). However it's possible that this > device has an inverted chip select and should be registered with the > SPI_CS_HIGH flag? It's logic level: * @set_cs: set the logic level of the chip select line. May be called * from interrupt context. See commit bd6857a0c630207484a03ddc470fab34b23f80bb Author: Geert Uytterhoeven Date: Tue Jan 21 16:10:07 2014 +0100 spi: Correct set_cs() documentation The documentation for spi_master.set_cs() says: assert or deassert chip select, true to assert i.e. its "enable" parameter uses assertion-level logic. This does not match the implementation of spi_set_cs(), which calls spi_master.set_cs() with the wanted logic level of the chip select line, which depends on the polarity of the chip select signal. Correct the documentation to match the implementation. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/