[PATCH V2 23/30] spi: qcom: Migrate to dev_pm_opp_set_config()

From: Viresh Kumar
Date: Fri Jul 01 2022 - 04:23:30 EST


The OPP core now provides a unified API for setting all configuration
types, i.e. dev_pm_opp_set_config().

Lets start using it.

Acked-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
---
Mark, I have kept your Ack as the diff is really small, clk_names is an array
now.

drivers/spi/spi-geni-qcom.c | 6 +++++-
drivers/spi/spi-qcom-qspi.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 4e83cc5b445d..428585bae6a8 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -892,6 +892,10 @@ static int spi_geni_probe(struct platform_device *pdev)
void __iomem *base;
struct clk *clk;
struct device *dev = &pdev->dev;
+ struct dev_pm_opp_config config = {
+ .clk_names = (const char *[]){ "se" },
+ .clk_count = 1,
+ };

irq = platform_get_irq(pdev, 0);
if (irq < 0)
@@ -922,7 +926,7 @@ static int spi_geni_probe(struct platform_device *pdev)
mas->se.base = base;
mas->se.clk = clk;

- ret = devm_pm_opp_set_clkname(&pdev->dev, "se");
+ ret = devm_pm_opp_set_config(&pdev->dev, &config);
if (ret)
return ret;
/* OPP table is optional */
diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c
index c334dfec4117..7e7732d61b25 100644
--- a/drivers/spi/spi-qcom-qspi.c
+++ b/drivers/spi/spi-qcom-qspi.c
@@ -458,6 +458,10 @@ static int qcom_qspi_probe(struct platform_device *pdev)
struct device *dev;
struct spi_master *master;
struct qcom_qspi *ctrl;
+ struct dev_pm_opp_config config = {
+ .clk_names = (const char *[]){ "core" },
+ .clk_count = 1,
+ };

dev = &pdev->dev;

@@ -529,7 +533,7 @@ static int qcom_qspi_probe(struct platform_device *pdev)
master->handle_err = qcom_qspi_handle_err;
master->auto_runtime_pm = true;

- ret = devm_pm_opp_set_clkname(&pdev->dev, "core");
+ ret = devm_pm_opp_set_config(&pdev->dev, &config);
if (ret)
return ret;
/* OPP table is optional */
--
2.31.1.272.g89b43f80a514