[RFC PATCH 10/10] spi: cadence-quadspi: Define cqspi_get_tuning_params()

Santhosh Kumar K
2025-08-11T19:56:56Z

Define cqspi_get_tuning_params() to extract information about the PHY
tuning pattern and it's size from controller.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
---
drivers/spi/spi-cadence-quadspi.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 1626cb9a9700..c9c4341d3275 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -2170,6 +2170,14 @@ static int cqspi_mem_execute_tuning(struct spi_mem *mem,
return ret;
}

+static int cqspi_get_tuning_params(struct spi_mem *mem,
+ struct spi_mem_tuning_params *tuning_params)
+{
+ tuning_params->pattern_ptr = phy_tuning_pattern;
+ tuning_params->pattern_size = sizeof(phy_tuning_pattern);
+ return 0;
+}
+
static int cqspi_of_get_flash_pdata(struct platform_device *pdev,
struct cqspi_flash_pdata *f_pdata,
struct device_node *np)
@@ -2345,6 +2353,7 @@ static const struct spi_controller_mem_ops cqspi_mem_ops = {
.get_name = cqspi_get_name,
.supports_op = cqspi_supports_mem_op,
.execute_tuning = cqspi_mem_execute_tuning,
+ .get_tuning_params = cqspi_get_tuning_params,
};

static const struct spi_controller_mem_caps cqspi_mem_caps = {
--
2.34.1