diff options
author | Anatolij Gustschin <agust@denx.de> | 2011-06-01 12:36:49 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-06-03 17:01:14 -0400 |
commit | 8c99268431a117207a89be5167ecd69429fd4bda (patch) | |
tree | d5c288a5b473be7fd5bc23b396ed42cbaf8f81dd /drivers/spi | |
parent | 8b20c8cb89b733f5a73fad1f7ad7cff8325e0034 (diff) |
spi/bitbang: initialize bits_per_word as specified by spi message
SPI protocol drivers can submit messages specifying needed bits_per_word
parameter for a message transfer. The bitbang driver currently ignores
bits_per_word given by a singe message and always uses master's
bits_per_word parameter. Only use master's bits_per_word when a
message didn't specify needed bits_per_word for ongoing transfer.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi_bitbang.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 14a63f6010d1..bb38c83ba210 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c | |||
@@ -68,7 +68,7 @@ static unsigned bitbang_txrx_8( | |||
68 | unsigned ns, | 68 | unsigned ns, |
69 | struct spi_transfer *t | 69 | struct spi_transfer *t |
70 | ) { | 70 | ) { |
71 | unsigned bits = spi->bits_per_word; | 71 | unsigned bits = t->bits_per_word ? : spi->bits_per_word; |
72 | unsigned count = t->len; | 72 | unsigned count = t->len; |
73 | const u8 *tx = t->tx_buf; | 73 | const u8 *tx = t->tx_buf; |
74 | u8 *rx = t->rx_buf; | 74 | u8 *rx = t->rx_buf; |
@@ -94,7 +94,7 @@ static unsigned bitbang_txrx_16( | |||
94 | unsigned ns, | 94 | unsigned ns, |
95 | struct spi_transfer *t | 95 | struct spi_transfer *t |
96 | ) { | 96 | ) { |
97 | unsigned bits = spi->bits_per_word; | 97 | unsigned bits = t->bits_per_word ? : spi->bits_per_word; |
98 | unsigned count = t->len; | 98 | unsigned count = t->len; |
99 | const u16 *tx = t->tx_buf; | 99 | const u16 *tx = t->tx_buf; |
100 | u16 *rx = t->rx_buf; | 100 | u16 *rx = t->rx_buf; |
@@ -120,7 +120,7 @@ static unsigned bitbang_txrx_32( | |||
120 | unsigned ns, | 120 | unsigned ns, |
121 | struct spi_transfer *t | 121 | struct spi_transfer *t |
122 | ) { | 122 | ) { |
123 | unsigned bits = spi->bits_per_word; | 123 | unsigned bits = t->bits_per_word ? : spi->bits_per_word; |
124 | unsigned count = t->len; | 124 | unsigned count = t->len; |
125 | const u32 *tx = t->tx_buf; | 125 | const u32 *tx = t->tx_buf; |
126 | u32 *rx = t->rx_buf; | 126 | u32 *rx = t->rx_buf; |