]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Blackfin: bfin_spi: let boards control idle value
authorCliff Cai <cliff.cai@analog.com>
Tue, 17 Nov 2009 09:36:21 +0000 (09:36 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 17 Jan 2010 14:17:27 +0000 (09:17 -0500)
Some SPI devices like to see high idle values rather than low.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
drivers/spi/bfin_spi.c

index 2a72f99b2482ee278b3e5452830de3dd4e0f5d11..093166efed8f6155329b703f1a1bed2d533973eb 100644 (file)
@@ -314,6 +314,10 @@ void spi_release_bus(struct spi_slave *slave)
        SSYNC();
 }
 
+#ifndef CONFIG_BFIN_SPI_IDLE_VAL
+# define CONFIG_BFIN_SPI_IDLE_VAL 0xff
+#endif
+
 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
                void *din, unsigned long flags)
 {
@@ -340,7 +344,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 
        /* todo: take advantage of hardware fifos and setup RX dma */
        while (bytes--) {
-               u8 value = (tx ? *tx++ : 0);
+               u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL);
                debug("%s: tx:%x ", __func__, value);
                write_SPI_TDBR(bss, value);
                SSYNC();