summaryrefslogtreecommitdiff
path: root/drivers/spi/bfin_spi.c
diff options
context:
space:
mode:
authorCliff Cai <cliff.cai@analog.com>2009-11-17 09:36:21 +0000
committerMike Frysinger <vapier@gentoo.org>2010-01-17 09:17:27 -0500
commit17ebd5bf3393144f3ead19384318a6e5b01c4f90 (patch)
tree55e7b046751cd5c190d971112ca89c3e53cf8655 /drivers/spi/bfin_spi.c
parentea693f22d8dbd8a65867a60a7f3faac30f85d65b (diff)
downloadu-boot-imx-17ebd5bf3393144f3ead19384318a6e5b01c4f90.zip
u-boot-imx-17ebd5bf3393144f3ead19384318a6e5b01c4f90.tar.gz
u-boot-imx-17ebd5bf3393144f3ead19384318a6e5b01c4f90.tar.bz2
Blackfin: bfin_spi: let boards control idle value
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>
Diffstat (limited to 'drivers/spi/bfin_spi.c')
-rw-r--r--drivers/spi/bfin_spi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index 2a72f99..093166e 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -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();