Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
spi_gpio.h
Go to the documentation of this file.
1 #ifndef __LINUX_SPI_GPIO_H
2 #define __LINUX_SPI_GPIO_H
3 
4 /*
5  * For each bitbanged SPI bus, set up a platform_device node with:
6  * - name "spi_gpio"
7  * - id the same as the SPI bus number it implements
8  * - dev.platform data pointing to a struct spi_gpio_platform_data
9  *
10  * Or, see the driver code for information about speedups that are
11  * possible on platforms that support inlined access for GPIOs (no
12  * spi_gpio_platform_data is used).
13  *
14  * Use spi_board_info with these busses in the usual way, being sure
15  * that the controller_data being the GPIO used for each device's
16  * chipselect:
17  *
18  * static struct spi_board_info ... [] = {
19  * ...
20  * // this slave uses GPIO 42 for its chipselect
21  * .controller_data = (void *) 42,
22  * ...
23  * // this one uses GPIO 86 for its chipselect
24  * .controller_data = (void *) 86,
25  * ...
26  * };
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  *
32  * If the MISO or MOSI pin is not available then it should be set to
33  * SPI_GPIO_NO_MISO or SPI_GPIO_NO_MOSI.
34  *
35  * If the bitbanged bus is later switched to a "native" controller,
36  * that platform_device and controller_data should be removed.
37  */
38 
39 #define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l)
40 #define SPI_GPIO_NO_MISO ((unsigned long)-1l)
41 #define SPI_GPIO_NO_MOSI ((unsigned long)-1l)
42 
64  unsigned sck;
65  unsigned mosi;
66  unsigned miso;
67 
69 };
70 
71 #endif /* __LINUX_SPI_GPIO_H */