9
0
Fork 0

spi: mvebu: only read from bus when data is needed

This optimization reduced the time to transfer 40 MB at 50 MHz from
214 seconds to 203 seconds.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Uwe Kleine-König 2016-12-08 10:39:22 +01:00 committed by Sascha Hauer
parent 45791cc9db
commit dcb880cb85
1 changed files with 5 additions and 5 deletions

View File

@ -278,12 +278,12 @@ static int mvebu_spi_do_transfer(struct spi_device *spi,
return ret; return ret;
} }
data = readl(priv->base + SPI_DATA_IN); if (rxdata) {
data = readl(priv->base + SPI_DATA_IN);
if (rxdata)
*rxdata++ = (data & 0xff); *rxdata++ = (data & 0xff);
if (rxdata && priv->data16) if (priv->data16)
*rxdata++ = (data >> 8) & 0xff; *rxdata++ = (data >> 8) & 0xff;
}
} }
return 0; return 0;