[PATCH DO NOT MERGE RFC 4/4] spi: cadence-qspi: Retrieve DQS capability using the core helper

Miquel Raynal posted 4 patches 3 days, 23 hours ago
[PATCH DO NOT MERGE RFC 4/4] spi: cadence-qspi: Retrieve DQS capability using the core helper
Posted by Miquel Raynal 3 days, 23 hours ago
This is just a suggestion for Santhosh on how to get the DQS capability
information without the DT property, to introduce in his Cadence QSPI
PHY tuning series:
https://lore.kernel.org/linux-spi/87v7gbdwdh.fsf@bootlin.com/T/#t

This patch shall not be applied as-is and is just given as an FYI.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-cadence-quadspi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 4f799f747346..0809846a6ef0 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -3476,6 +3476,12 @@ static int cqspi_mem_op_execute_tuning(struct spi_mem *mem,
 	if (!cqspi->ddata->execute_tuning)
 		return -EOPNOTSUPP;
 
+	/*
+	 * FIXME: maybe this boolean could be queried when needed by
+	 * saving a pointer to the spi memory somewhere?
+	 */
+	cqspi->f_pdata->has_dqs = spi_mem_has_dqs(mem);
+
 	return cqspi->ddata->execute_tuning(mem, read_op, write_op);
 }
 
@@ -3517,8 +3523,6 @@ static int cqspi_of_get_flash_pdata(struct platform_device *pdev,
 		f_pdata->non_phy_clk_rate =
 			f_pdata->cqspi->ddata->get_non_phy_clk_rate(f_pdata->cqspi);
 
-	f_pdata->has_dqs = of_property_read_bool(np, "spi-has-dqs");
-
 	return 0;
 }
 

-- 
2.51.1