From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 15 Dec 2008 11:12:01 +1100 From: David Gibson To: "Steven A. Falco" Subject: Re: [RFC] Dummy GPIO driver for use with SPI Message-ID: <20081215001201.GB15327@yookeroo.seuss> References: <4942738A.80609@harris.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <4942738A.80609@harris.com> Cc: "linuxppc-dev@ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Dec 12, 2008 at 09:22:02AM -0500, Steven A. Falco wrote: > This patch adds a dummy GPIO driver, which is useful for SPI devices > that do not have a physical chip select. > > Signed-off-by: Steven A. Falco > --- > The SPI subsystem requires a chip-select for each connected slave > device. I have a custom board with an Atmel "co-processor". This part > is reprogrammed via SPI, so it needs a chip select to satisfy the SPI > subsystem, but my hardware does not have a physical CS connected. > > I could waste a "no-connect" GPIO pin, but I'd rather not. So, I've > written a dummy GPIO driver, which behaves exactly like a real GPIO > device, but with no underlying hardware. This could also be useful > as a template for real GPIO drivers. > > I use the following dts entry: > > GPIO3: dummy@ef500000 { > compatible = "linux,dummy-gpio"; > reg = ; > gpio-controller; > #gpio-cells = <2>; > }; This is not sane. I can see reasons it might be useful to have a dummy gpio driver within the kernel, but since this doesn't represent any real hardware, it should not appear in the device tree. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson