Skip to content

Commit

Permalink
spi: imx: use PIO mode if size is small
Browse files Browse the repository at this point in the history
Use PIO mode instead if size is smaller than fifo size, since
dma may be less efficient.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Robin Gong authored and Mark Brown committed Oct 12, 2018
1 parent 5ba5a37 commit 133eb8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/spi-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
if (spi_imx->slave_mode)
return false;

if (transfer->len < spi_imx->devtype_data->fifo_size)
return false;

spi_imx->dynamic_burst = 0;

return true;
Expand Down

0 comments on commit 133eb8e

Please sign in to comment.