diff options
author | Mark Brown <broonie@kernel.org> | 2015-11-04 06:02:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-11-04 06:02:02 -0500 |
commit | f0a2a049f5e33670448b189bfb05d73a5a37ff25 (patch) | |
tree | 5eb873726bf2312f90d02bb4db327e9c9e585a22 | |
parent | 3e7018def475847418596c76997e0708bacda2c0 (diff) | |
parent | 8cae0424787ba02987a6f3a6117f31f6a77260dc (diff) |
Merge remote-tracking branch 'spi/topic/davinci' into spi-next
-rw-r--r-- | drivers/spi/spi-davinci.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index a85d863d4a44..7d3af3eacf57 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c | |||
@@ -215,18 +215,10 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value) | |||
215 | struct davinci_spi_config *spicfg = spi->controller_data; | 215 | struct davinci_spi_config *spicfg = spi->controller_data; |
216 | u8 chip_sel = spi->chip_select; | 216 | u8 chip_sel = spi->chip_select; |
217 | u16 spidat1 = CS_DEFAULT; | 217 | u16 spidat1 = CS_DEFAULT; |
218 | bool gpio_chipsel = false; | ||
219 | int gpio; | ||
220 | 218 | ||
221 | dspi = spi_master_get_devdata(spi->master); | 219 | dspi = spi_master_get_devdata(spi->master); |
222 | pdata = &dspi->pdata; | 220 | pdata = &dspi->pdata; |
223 | 221 | ||
224 | if (spi->cs_gpio >= 0) { | ||
225 | /* SPI core parse and update master->cs_gpio */ | ||
226 | gpio_chipsel = true; | ||
227 | gpio = spi->cs_gpio; | ||
228 | } | ||
229 | |||
230 | /* program delay transfers if tx_delay is non zero */ | 222 | /* program delay transfers if tx_delay is non zero */ |
231 | if (spicfg->wdelay) | 223 | if (spicfg->wdelay) |
232 | spidat1 |= SPIDAT1_WDEL; | 224 | spidat1 |= SPIDAT1_WDEL; |
@@ -235,11 +227,12 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value) | |||
235 | * Board specific chip select logic decides the polarity and cs | 227 | * Board specific chip select logic decides the polarity and cs |
236 | * line for the controller | 228 | * line for the controller |
237 | */ | 229 | */ |
238 | if (gpio_chipsel) { | 230 | if (spi->cs_gpio >= 0) { |
239 | if (value == BITBANG_CS_ACTIVE) | 231 | if (value == BITBANG_CS_ACTIVE) |
240 | gpio_set_value(gpio, spi->mode & SPI_CS_HIGH); | 232 | gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH); |
241 | else | 233 | else |
242 | gpio_set_value(gpio, !(spi->mode & SPI_CS_HIGH)); | 234 | gpio_set_value(spi->cs_gpio, |
235 | !(spi->mode & SPI_CS_HIGH)); | ||
243 | } else { | 236 | } else { |
244 | if (value == BITBANG_CS_ACTIVE) { | 237 | if (value == BITBANG_CS_ACTIVE) { |
245 | spidat1 |= SPIDAT1_CSHOLD_MASK; | 238 | spidat1 |= SPIDAT1_CSHOLD_MASK; |