Commit c3e2aa86 authored by Anatolij Gustschin's avatar Anatolij Gustschin Committed by Mark Brown

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: default avatarAnatolij Gustschin <agust@denx.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 86e98743
...@@ -149,6 +149,9 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi, ...@@ -149,6 +149,9 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
in_8(&psc->mode); in_8(&psc->mode);
out_8(&psc->mode, 0x0); out_8(&psc->mode, 0x0);
/* enable transmiter/receiver */
out_8(&psc->command, MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);
while (len) { while (len) {
int count; int count;
int i; int i;
...@@ -177,10 +180,6 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi, ...@@ -177,10 +180,6 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY); out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY); out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY);
/* enable transmiter/receiver */
out_8(&psc->command,
MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);
wait_for_completion(&mps->done); wait_for_completion(&mps->done);
mdelay(1); mdelay(1);
...@@ -205,9 +204,6 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi, ...@@ -205,9 +204,6 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
while (in_be32(&fifo->rxcnt)) { while (in_be32(&fifo->rxcnt)) {
in_8(&fifo->rxdata_8); in_8(&fifo->rxdata_8);
} }
out_8(&psc->command,
MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
} }
/* disable transmiter/receiver and fifo interrupt */ /* disable transmiter/receiver and fifo interrupt */
out_8(&psc->command, MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE); out_8(&psc->command, MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment