mmc: sdhci-msm: Add interconnect bandwidth scaling support
authorPradeep P V K <ppvk@codeaurora.org>
Tue, 9 Jun 2020 08:37:25 +0000 (14:07 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 Jul 2020 10:18:22 +0000 (12:18 +0200)
Interconnect bandwidth scaling support is now added as a
part of OPP. So, make sure interconnect driver is ready
before handling interconnect scaling.

Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/1591691846-7578-2-git-send-email-ppvk@codeaurora.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-msm.c

index c0d58e9fcc33365a746bc005f601021e5cb69989..cdafc4f69ca5df29349b685aa5b0efc01c7381a4 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/slab.h>
 #include <linux/iopoll.h>
 #include <linux/regulator/consumer.h>
+#include <linux/interconnect.h>
 
 #include "sdhci-pltfm.h"
 #include "cqhci.h"
@@ -2071,6 +2072,11 @@ static int sdhci_msm_probe(struct platform_device *pdev)
        }
        msm_host->bulk_clks[0].clk = clk;
 
+        /* Check for optional interconnect paths */
+       ret = dev_pm_opp_of_find_icc_paths(&pdev->dev, NULL);
+       if (ret)
+               goto bus_clk_disable;
+
        msm_host->opp_table = dev_pm_opp_set_clkname(&pdev->dev, "core");
        if (IS_ERR(msm_host->opp_table)) {
                ret = PTR_ERR(msm_host->opp_table);