aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi-pxa2xx.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 158967a10bec..986a2911e94e 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -955,7 +955,18 @@ static void pump_transfers(unsigned long data)
955 "pump_transfers: DMA burst size reduced to match bits_per_word\n"); 955 "pump_transfers: DMA burst size reduced to match bits_per_word\n");
956 } 956 }
957 957
958 /* NOTE: PXA25x_SSP _could_ use external clocking ... */
958 cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits); 959 cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits);
960 if (!pxa25x_ssp_comp(drv_data))
961 dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
962 drv_data->master->max_speed_hz
963 / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)),
964 chip->enable_dma ? "DMA" : "PIO");
965 else
966 dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
967 drv_data->master->max_speed_hz / 2
968 / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)),
969 chip->enable_dma ? "DMA" : "PIO");
959 970
960 message->state = RUNNING_STATE; 971 message->state = RUNNING_STATE;
961 972
@@ -1099,9 +1110,7 @@ static int setup(struct spi_device *spi)
1099 struct chip_data *chip; 1110 struct chip_data *chip;
1100 const struct lpss_config *config; 1111 const struct lpss_config *config;
1101 struct driver_data *drv_data = spi_master_get_devdata(spi->master); 1112 struct driver_data *drv_data = spi_master_get_devdata(spi->master);
1102 unsigned int clk_div;
1103 uint tx_thres, tx_hi_thres, rx_thres; 1113 uint tx_thres, tx_hi_thres, rx_thres;
1104 u32 cr0;
1105 1114
1106 switch (drv_data->ssp_type) { 1115 switch (drv_data->ssp_type) {
1107 case QUARK_X1000_SSP: 1116 case QUARK_X1000_SSP:
@@ -1192,8 +1201,6 @@ static int setup(struct spi_device *spi)
1192 } 1201 }
1193 } 1202 }
1194 1203
1195 clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz);
1196
1197 switch (drv_data->ssp_type) { 1204 switch (drv_data->ssp_type) {
1198 case QUARK_X1000_SSP: 1205 case QUARK_X1000_SSP:
1199 chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres) 1206 chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres)
@@ -1214,19 +1221,6 @@ static int setup(struct spi_device *spi)
1214 if (spi->mode & SPI_LOOP) 1221 if (spi->mode & SPI_LOOP)
1215 chip->cr1 |= SSCR1_LBM; 1222 chip->cr1 |= SSCR1_LBM;
1216 1223
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))
1220 dev_dbg(&spi->dev, "%u Hz actual, %s\n",
1221 drv_data->master->max_speed_hz
1222 / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)),
1223 chip->enable_dma ? "DMA" : "PIO");
1224 else
1225 dev_dbg(&spi->dev, "%u Hz actual, %s\n",
1226 drv_data->master->max_speed_hz / 2
1227 / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)),
1228 chip->enable_dma ? "DMA" : "PIO");
1229
1230 if (spi->bits_per_word <= 8) { 1224 if (spi->bits_per_word <= 8) {
1231 chip->n_bytes = 1; 1225 chip->n_bytes = 1;
1232 chip->read = u8_reader; 1226 chip->read = u8_reader;