aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2013-04-01 11:31:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-09 12:53:39 -0400
commitc3e2aa861005ec390e8a7556d1a1e980be1a6e1f (patch)
tree3e62ae3e82a1a97db9480c1f0889d2db599b8798 /drivers/spi
parent86e98743ec168b98eea3dfacc1e8b5ff442eb70d (diff)
spi: spi-mpc512x-psc: let transmiter/receiver enabled when in xfer loop
There is no need to disable transmitter/receiver after each loop iteration and re-enable it for next loop iteration. Enable the transmitter/receiver before xfer loop starts and disable it when the whole transfer is done. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-mpc512x-psc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index da60f268f74c..dfddf336912d 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -149,6 +149,9 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
149 in_8(&psc->mode); 149 in_8(&psc->mode);
150 out_8(&psc->mode, 0x0); 150 out_8(&psc->mode, 0x0);
151 151
152 /* enable transmiter/receiver */
153 out_8(&psc->command, MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);
154
152 while (len) { 155 while (len) {
153 int count; 156 int count;
154 int i; 157 int i;
@@ -177,10 +180,6 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
177 out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY); 180 out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
178 out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY); 181 out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY);
179 182
180 /* enable transmiter/receiver */
181 out_8(&psc->command,
182 MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);
183
184 wait_for_completion(&mps->done); 183 wait_for_completion(&mps->done);
185 184
186 mdelay(1); 185 mdelay(1);
@@ -205,9 +204,6 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
205 while (in_be32(&fifo->rxcnt)) { 204 while (in_be32(&fifo->rxcnt)) {
206 in_8(&fifo->rxdata_8); 205 in_8(&fifo->rxdata_8);
207 } 206 }
208
209 out_8(&psc->command,
210 MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
211 } 207 }
212 /* disable transmiter/receiver and fifo interrupt */ 208 /* disable transmiter/receiver and fifo interrupt */
213 out_8(&psc->command, MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE); 209 out_8(&psc->command, MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);