[PATCH] spi: dw: fix wrong RX_SAMPLE_DLY setting after resume

From: Jisheng Zhang

Date: Mon Aug 03 2026 - 10:39:53 EST


On platforms which need a non-zero rx sample delay, the RX_SAMPLE_DLY
reg setting is lost after resume. The reason is that the reg may be
reset to 0 after resuming, but dws->cur_rx_sample_dly doesn't know
this fact. Fix this issue by clearing dws->cur_rx_sample_dly in
dw_spi_shutdown_chip().

Signed-off-by: Jisheng Zhang <jszhang@xxxxxxxxxx>
Suggested-by: Mark Brown <broonie@xxxxxxxxxx>
---
drivers/spi/spi-dw.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 2f2debc64e73..a9d055f9c5dd 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -283,6 +283,7 @@ static inline void dw_spi_shutdown_chip(struct dw_spi *dws)
dw_spi_enable_chip(dws, 0);
dw_spi_set_clk(dws, 0);
dws->current_freq = 0;
+ dws->cur_rx_sample_dly = 0;
}

extern void dw_spi_set_cs(struct spi_device *spi, bool enable);
--
2.53.0