Re: [RFC] Dummy GPIO driver for use with SPI
From: David Gibson <hidden>
Date: 2008-12-15 00:12:01
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 <redacted>
---
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 = <ef500000 1>;
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