[PATCH RFC 2/7] mtd: spinand: Add support for clock to RX delay setting

Frieder Schrempf
2026-03-03T16:37:10Z

From: Eberhard Stoll <eberhard.stoll@kontron.de>

Add the configuration parameter to set the SPI clock to receive
data delay parameter for SPI NAND devices.

This parameter is often referenced as tCLQV in SPI NAND device
data sheets.

Signed-off-by: Eberhard Stoll <eberhard.stoll@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
drivers/mtd/nand/spi/core.c | 1 +
include/linux/mtd/spinand.h | 5 +++++
2 files changed, 6 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 8aa3753aaaa1d..782a605018bc3 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1594,6 +1594,7 @@ int spinand_match_and_init(struct spinand_device *spinand,
spinand->user_otp = &table[i].user_otp;
spinand->read_retries = table[i].read_retries;
spinand->set_read_retry = table[i].set_read_retry;
+ spinand->spimem->spi->rx_sampling_delay_ns = table[i].rx_sampling_delay_ns;

/* I/O variants selection with single-spi SDR commands */

diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 6a024cf1c53ac..b76aaf0747962 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -568,6 +568,7 @@ enum spinand_bus_interface {
* @model: model name
* @devid: device ID
* @flags: OR-ing of the SPINAND_XXX flags
+ * @rx_sampling_delay_ns: clock to rx data delay timing (tCLQV)
* @memorg: memory organization
* @eccreq: ECC requirements
* @eccinfo: on-die ECC info
@@ -592,6 +593,7 @@ struct spinand_info {
const char *model;
struct spinand_devid devid;
u32 flags;
+ u32 rx_sampling_delay_ns;
struct nand_memory_organization memorg;
struct nand_ecc_props eccreq;
struct spinand_ecc_info eccinfo;
@@ -643,6 +645,9 @@ struct spinand_info {
#define SPINAND_CONFIGURE_CHIP(__configure_chip) \
.configure_chip = __configure_chip

+#define SPINAND_RX_SAMPLING_DELAY(__delay) \
+ .rx_sampling_delay_ns = __delay
+
#define SPINAND_CONT_READ(__set_cont_read) \
.set_cont_read = __set_cont_read

--
2.53.0