[PATCH RFC 6/7] spi: spi-mem: Call spi_set_rx_sampling_point() for each op

Frieder Schrempf
2026-03-03T16:30:06Z

From: Frieder Schrempf <frieder.schrempf@kontron.de>

With clock rates changing on a per-op basis, we need to make sure
that we meet the RX sampling point delay constraint of the underlying
SPI chip.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
drivers/spi/spi-mem.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index a09371a075d2e..6b8bee7d6f5e3 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -589,6 +589,8 @@ void spi_mem_adjust_op_freq(struct spi_mem *mem, struct spi_mem_op *op)
{
if (!op->max_freq || op->max_freq > mem->spi->max_speed_hz)
op->max_freq = mem->spi->max_speed_hz;
+
+ op->max_freq = spi_set_rx_sampling_point(mem->spi, op->max_freq);
}
EXPORT_SYMBOL_GPL(spi_mem_adjust_op_freq);

--
2.53.0