Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1234e839 authored by Frode Isaksen's avatar Frode Isaksen Committed by Mark Brown
Browse files

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: default avatarFrode Isaksen <fisaksen@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4dd9becb
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -660,7 +660,11 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
			goto err_desc;
			goto err_desc;


		if (!t->tx_buf) {
		if (!t->tx_buf) {
			/* use rx buffer as dummy tx buffer */
			/* To avoid errors when doing rx-only transfers with
			 * many SG entries (> 20), use the rx buffer as the
			 * dummy tx buffer so that dma reloads are done at the
			 * same time for rx and tx.
			 */
			t->tx_sg.sgl = t->rx_sg.sgl;
			t->tx_sg.sgl = t->rx_sg.sgl;
			t->tx_sg.nents = t->rx_sg.nents;
			t->tx_sg.nents = t->rx_sg.nents;
		}
		}