diff mbox series

[2/3] spi: orion: Support spi_xfer->word_delay_usecs

Message ID 36a76356d1ff2e08ebfd43fdfbe6360d5b979e35.1551971833.git.jan.kundrat@cesnet.cz (mailing list archive)
State Accepted
Commit 84d8df745b622ada89ef427541ad03e928269f09
Headers show
Series inter-word delays for spidev and spi-orion | expand

Commit Message

Jan Kundrát March 7, 2019, 2:38 p.m. UTC
Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
---
 drivers/spi/spi-orion.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 7822fd73e0b9..eb70a9dc31ac 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -470,6 +470,8 @@  orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
 			if (orion_spi_write_read_8bit(spi, &tx, &rx) < 0)
 				goto out;
 			count--;
+			if (xfer->word_delay_usecs)
+				udelay(xfer->word_delay_usecs);
 		} while (count);
 	} else if (word_len == 16) {
 		const u16 *tx = xfer->tx_buf;
@@ -479,6 +481,8 @@  orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
 			if (orion_spi_write_read_16bit(spi, &tx, &rx) < 0)
 				goto out;
 			count -= 2;
+			if (xfer->word_delay_usecs)
+				udelay(xfer->word_delay_usecs);
 		} while (count);
 	}