mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
spi/spi-gpio: add support for controllers without MISO or MOSI pin
There are some boards that do not strictly follow SPI standard and use only 3 wires (SCLK, MOSI or MISO, SS) for connecting some simple auxiliary chips and controls them with GPIO based 'spi controller'. In this configuration the MISO or MOSI line is missing (it is not required if the chip does not transfer any data back to host or host only reads data from chip). This patch adds support for such non-standard configuration in GPIO-based SPI controller. It has been tested in configuration without MISO pin. Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
parent
04bb2a031c
commit
3c8e1a84fd
2 changed files with 88 additions and 18 deletions
|
@ -29,11 +29,16 @@
|
|||
* SPI_GPIO_NO_CHIPSELECT to the controller_data:
|
||||
* .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT;
|
||||
*
|
||||
* If the MISO or MOSI pin is not available then it should be set to
|
||||
* SPI_GPIO_NO_MISO or SPI_GPIO_NO_MOSI.
|
||||
*
|
||||
* If the bitbanged bus is later switched to a "native" controller,
|
||||
* that platform_device and controller_data should be removed.
|
||||
*/
|
||||
|
||||
#define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l)
|
||||
#define SPI_GPIO_NO_MISO ((unsigned long)-1l)
|
||||
#define SPI_GPIO_NO_MOSI ((unsigned long)-1l)
|
||||
|
||||
/**
|
||||
* struct spi_gpio_platform_data - parameter for bitbanged SPI master
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue