spi controller mode check update
PATCH 1/1 spi controller mode check update
This lets bitbanging SPI controller drivers declare that they support modes like SPI_CS_HIGH and SPI_3WIRE.
Signed-off-by David Brownell <[email protected]>
---
This updates a patch in 2.6.22-rc3 called
spi-controller-drivers-check-for-unsupported-modes.patch
drivers/spi/spi_bitbang.c | 12 +++--------- include/linux/spi/spi_bitbang.h | 1 + 2 files changed, 4 insertions(+), 9 deletions(-)
include/linux/spi/spi_bitbang.h +1 -0
@@ -26,6 +26,7 @@ struct spi_bitbang {struct list_head queue;u8 busy;u8 use_dma; +u8 flags;/* extra spi->mode support */ struct spi_master *master;
drivers/spi/spi_bitbang.c +3 -9
@@ -187,16 +187,10 @@ int spi_bitbang_setup(struct spi_device bitbang =spi_master_get_devdata (spi->master); -/* REVISIT: some systems will want to support devices using lsb-first -* bit encodings on the wire. In pure software that would be trivial, -* just bitbang_txrx_le_cphaX() routines shifting the other way, and -* some hardware controllers also have this support. -* -* REVISIT: we should accept SPI_CS_HIGH in some cases; it's -* easy to implement that with GPIOs, but we don't know if the -* underlying chipselect() method support that... +/* Bitbangers can support SPI_CS_HIGH, SPI_3WIRE, and so on; +* add those to master->flags, and provide the other support. */ -if ((spi->mode & ~(SPI_CPOL |SPI_CPHA )) !=0 ) +if ((spi->mode & ~(SPI_CPOL |SPI_CPHA |bitbang->flags)) !=0 )return -EINVAL ;if (!cs) {
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/