aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_gpio.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2010-06-30 16:27:32 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-04 00:45:44 -0400
commit04bb2a031cf95b34b7432dd47b318a932a895b4c (patch)
treed5c831a56c01b4a357450abae47f1afe8d61de34 /drivers/spi/spi_gpio.c
parent5c2818cdfad1973ede3dcd2a8709620a192f8385 (diff)
spi/bitbang: add support for SPI_MASTER_NO_{TX, RX} modes
This patch adds a new flags argument to bitbang_txrx_be_cpha0 and bitbang_txrx_be_cpha1 transfer functions. This enables support for SPI_MASTER_NO_{TX,RX} transfer modes. The change should have no impact on speed of the existing drivers. bitbank_txrx_* functions are usually inlined into the drivers. When the argument is equal to constant zero, the optimizer would be able to eliminate the dead code (flags checks) easily. Tested on ARM and GCC 4.4.x and in all cases the checks were eliminated in the inlined function. 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>
Diffstat (limited to 'drivers/spi/spi_gpio.c')
-rw-r--r--drivers/spi/spi_gpio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi_gpio.c b/drivers/spi/spi_gpio.c
index 7edbd5807e0e..82b480cc9637 100644
--- a/drivers/spi/spi_gpio.c
+++ b/drivers/spi/spi_gpio.c
@@ -146,25 +146,25 @@ static inline int getmiso(const struct spi_device *spi)
146static u32 spi_gpio_txrx_word_mode0(struct spi_device *spi, 146static u32 spi_gpio_txrx_word_mode0(struct spi_device *spi,
147 unsigned nsecs, u32 word, u8 bits) 147 unsigned nsecs, u32 word, u8 bits)
148{ 148{
149 return bitbang_txrx_be_cpha0(spi, nsecs, 0, word, bits); 149 return bitbang_txrx_be_cpha0(spi, nsecs, 0, 0, word, bits);
150} 150}
151 151
152static u32 spi_gpio_txrx_word_mode1(struct spi_device *spi, 152static u32 spi_gpio_txrx_word_mode1(struct spi_device *spi,
153 unsigned nsecs, u32 word, u8 bits) 153 unsigned nsecs, u32 word, u8 bits)
154{ 154{
155 return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits); 155 return bitbang_txrx_be_cpha1(spi, nsecs, 0, 0, word, bits);
156} 156}
157 157
158static u32 spi_gpio_txrx_word_mode2(struct spi_device *spi, 158static u32 spi_gpio_txrx_word_mode2(struct spi_device *spi,
159 unsigned nsecs, u32 word, u8 bits) 159 unsigned nsecs, u32 word, u8 bits)
160{ 160{
161 return bitbang_txrx_be_cpha0(spi, nsecs, 1, word, bits); 161 return bitbang_txrx_be_cpha0(spi, nsecs, 1, 0, word, bits);
162} 162}
163 163
164static u32 spi_gpio_txrx_word_mode3(struct spi_device *spi, 164static u32 spi_gpio_txrx_word_mode3(struct spi_device *spi,
165 unsigned nsecs, u32 word, u8 bits) 165 unsigned nsecs, u32 word, u8 bits)
166{ 166{
167 return bitbang_txrx_be_cpha1(spi, nsecs, 1, word, bits); 167 return bitbang_txrx_be_cpha1(spi, nsecs, 1, 0, word, bits);
168} 168}
169 169
170/*----------------------------------------------------------------------*/ 170/*----------------------------------------------------------------------*/