diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2015-09-15 09:26:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-09-17 13:36:15 -0400 |
commit | b69d42b5c44bcfc1c73fe185d4644487f1bd3193 (patch) | |
tree | 430041fa2efbd65691213794c456278fe0fbc1ae /drivers/spi/spi-pxa2xx.c | |
parent | 196b0e2cf2373f43d7b0e8c1a63e9d528c06e1df (diff) |
spi: pxa2xx: Remove cr0 variable from struct chip_data
There hasn't been need to carry chip->cr0 after SPI core started to
validate speed_hz and bits_per_word transfer parameters. That effectively
caused that pump_transfers() always recalculated it and practically
chip->cr0 is used locally in setup() for debug prints only.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index ebafd537b59f..a25bc1d4bf7f 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1101,6 +1101,7 @@ static int setup(struct spi_device *spi) | |||
1101 | struct driver_data *drv_data = spi_master_get_devdata(spi->master); | 1101 | struct driver_data *drv_data = spi_master_get_devdata(spi->master); |
1102 | unsigned int clk_div; | 1102 | unsigned int clk_div; |
1103 | uint tx_thres, tx_hi_thres, rx_thres; | 1103 | uint tx_thres, tx_hi_thres, rx_thres; |
1104 | u32 cr0; | ||
1104 | 1105 | ||
1105 | switch (drv_data->ssp_type) { | 1106 | switch (drv_data->ssp_type) { |
1106 | case QUARK_X1000_SSP: | 1107 | case QUARK_X1000_SSP: |
@@ -1193,8 +1194,6 @@ static int setup(struct spi_device *spi) | |||
1193 | 1194 | ||
1194 | clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz); | 1195 | clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz); |
1195 | 1196 | ||
1196 | chip->cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, | ||
1197 | spi->bits_per_word); | ||
1198 | switch (drv_data->ssp_type) { | 1197 | switch (drv_data->ssp_type) { |
1199 | case QUARK_X1000_SSP: | 1198 | case QUARK_X1000_SSP: |
1200 | chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres) | 1199 | chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres) |
@@ -1216,15 +1215,16 @@ static int setup(struct spi_device *spi) | |||
1216 | chip->cr1 |= SSCR1_LBM; | 1215 | chip->cr1 |= SSCR1_LBM; |
1217 | 1216 | ||
1218 | /* NOTE: PXA25x_SSP _could_ use external clocking ... */ | 1217 | /* NOTE: PXA25x_SSP _could_ use external clocking ... */ |
1218 | cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, spi->bits_per_word); | ||
1219 | if (!pxa25x_ssp_comp(drv_data)) | 1219 | if (!pxa25x_ssp_comp(drv_data)) |
1220 | dev_dbg(&spi->dev, "%ld Hz actual, %s\n", | 1220 | dev_dbg(&spi->dev, "%ld Hz actual, %s\n", |
1221 | drv_data->max_clk_rate | 1221 | drv_data->max_clk_rate |
1222 | / (1 + ((chip->cr0 & SSCR0_SCR(0xfff)) >> 8)), | 1222 | / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)), |
1223 | chip->enable_dma ? "DMA" : "PIO"); | 1223 | chip->enable_dma ? "DMA" : "PIO"); |
1224 | else | 1224 | else |
1225 | dev_dbg(&spi->dev, "%ld Hz actual, %s\n", | 1225 | dev_dbg(&spi->dev, "%ld Hz actual, %s\n", |
1226 | drv_data->max_clk_rate / 2 | 1226 | drv_data->max_clk_rate / 2 |
1227 | / (1 + ((chip->cr0 & SSCR0_SCR(0x0ff)) >> 8)), | 1227 | / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)), |
1228 | chip->enable_dma ? "DMA" : "PIO"); | 1228 | chip->enable_dma ? "DMA" : "PIO"); |
1229 | 1229 | ||
1230 | if (spi->bits_per_word <= 8) { | 1230 | if (spi->bits_per_word <= 8) { |
@@ -1236,8 +1236,6 @@ static int setup(struct spi_device *spi) | |||
1236 | chip->read = u16_reader; | 1236 | chip->read = u16_reader; |
1237 | chip->write = u16_writer; | 1237 | chip->write = u16_writer; |
1238 | } else if (spi->bits_per_word <= 32) { | 1238 | } else if (spi->bits_per_word <= 32) { |
1239 | if (!is_quark_x1000_ssp(drv_data)) | ||
1240 | chip->cr0 |= SSCR0_EDSS; | ||
1241 | chip->n_bytes = 4; | 1239 | chip->n_bytes = 4; |
1242 | chip->read = u32_reader; | 1240 | chip->read = u32_reader; |
1243 | chip->write = u32_writer; | 1241 | chip->write = u32_writer; |