aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrode Isaksen <fisaksen@baylibre.com>2017-03-17 11:41:10 -0400
committerMark Brown <broonie@kernel.org>2017-03-17 18:00:51 -0400
commit1234e8398fe03267bf2e353e36825dbd0abc2fc6 (patch)
tree6ecedf5fbb11175762f7506032ed33dce32e40da
parent4dd9becbce4f10009322c3e2297f9db3ace94a10 (diff)
spi: davinci: add comment about dummy tx buffer usage
Add explanation about using the the rx buffer as the dummy tx buffer. Signed-off-by: Frode Isaksen <fisaksen@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-davinci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index f37bbdd18d61..595acdcfc7d0 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -660,7 +660,11 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
660 goto err_desc; 660 goto err_desc;
661 661
662 if (!t->tx_buf) { 662 if (!t->tx_buf) {
663 /* use rx buffer as dummy tx buffer */ 663 /* To avoid errors when doing rx-only transfers with
664 * many SG entries (> 20), use the rx buffer as the
665 * dummy tx buffer so that dma reloads are done at the
666 * same time for rx and tx.
667 */
664 t->tx_sg.sgl = t->rx_sg.sgl; 668 t->tx_sg.sgl = t->rx_sg.sgl;
665 t->tx_sg.nents = t->rx_sg.nents; 669 t->tx_sg.nents = t->rx_sg.nents;
666 } 670 }