summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Curutchet <bastien.curutchet@bootlin.com>2024-09-20 10:28:06 +0200
committerTom Rini <trini@konsulko.com>2024-10-02 13:38:37 -0600
commit983fd3d06db68e57a0fc8d6e4a2dffe4c69e9743 (patch)
treea5003e08b676c68a33196f9070285a7467392375
parent7bc5f66f55fd1a3106e8e6beb91949e0c34fc7b1 (diff)
spi: davinci: Drop the preload of TX buffer before read/writes operations
A write to the TX buffer is performed before entering the loop to "avoid clock starvation". This sometimes results in subsequent writes in davinci_spi_xfer_data() to occur while the TXFULL bit is asserted, leading to write failures. Remove the preload of the TX buffer. Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
-rw-r--r--drivers/spi/davinci_spi.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 82049872d05..19bd06cf872 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -129,9 +129,6 @@ static int davinci_spi_read(struct davinci_spi_slave *ds, unsigned int len,
while (readl(&ds->regs->buf) & SPIBUF_TXFULL_MASK)
;
- /* preload the TX buffer to avoid clock starvation */
- writel(data1_reg_val, &ds->regs->dat1);
-
/* keep reading 1 byte until only 1 byte left */
while ((len--) > 1)
*rxp++ = davinci_spi_xfer_data(ds, data1_reg_val);
@@ -159,12 +156,6 @@ static int davinci_spi_write(struct davinci_spi_slave *ds, unsigned int len,
while (readl(&ds->regs->buf) & SPIBUF_TXFULL_MASK)
;
- /* preload the TX buffer to avoid clock starvation */
- if (len > 2) {
- writel(data1_reg_val | *txp++, &ds->regs->dat1);
- len--;
- }
-
/* keep writing 1 byte until only 1 byte left */
while ((len--) > 1)
davinci_spi_xfer_data(ds, data1_reg_val | *txp++);