aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-04-02 19:57:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:04:51 -0400
commitbfb9bcdbda9a61bca469bf899a589918c60c4c18 (patch)
tree40b28178c9d969c94e2039b27ac213cab5de0e79 /include/linux/spi
parent8a0cecffeb52363a57257bbbbd58f4c4537a75bb (diff)
spi-gpio: allow operation without CS signal
Change spi-gpio so that it is possible to drive SPI communications over GPIO without the need for a chipselect signal. This is useful in very small setups where there's only one slave device on the bus. This patch does not affect existing setups. I use this for a tiny communication channel between an embedded device and a microcontroller. There are not enough GPIOs available for chipselect and it's not needed anyway in this case. Signed-off-by: Michael Buesch <mb@bu3sch.de> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi_gpio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h
index 0f01a0f1f40c..ca6782ee4b9f 100644
--- a/include/linux/spi/spi_gpio.h
+++ b/include/linux/spi/spi_gpio.h
@@ -25,10 +25,16 @@
25 * ... 25 * ...
26 * }; 26 * };
27 * 27 *
28 * If chipselect is not used (there's only one device on the bus), assign
29 * SPI_GPIO_NO_CHIPSELECT to the controller_data:
30 * .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT;
31 *
28 * If the bitbanged bus is later switched to a "native" controller, 32 * If the bitbanged bus is later switched to a "native" controller,
29 * that platform_device and controller_data should be removed. 33 * that platform_device and controller_data should be removed.
30 */ 34 */
31 35
36#define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l)
37
32/** 38/**
33 * struct spi_gpio_platform_data - parameter for bitbanged SPI master 39 * struct spi_gpio_platform_data - parameter for bitbanged SPI master
34 * @sck: number of the GPIO used for clock output 40 * @sck: number of the GPIO used for clock output