Skip to content

Commit 1b19562

Browse files
committed
PM / devfreq: tegra30: Register config_clks helper
There is a corner case with Tegra30, where we want to skip clk configuration that happens via dev_pm_opp_set_opp(), but still want the OPP core to read the "opp-hz" property so we can find the right OPP via freq finding helpers. The OPP core provides support for the platforms to provide config_clks helpers now, lets use that instead of devm_pm_opp_of_add_table_noclk() to achieve the same result, as the OPP core won't parse the DT's "opp-hz" property anymore if the clock isn't provided. Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 2f71ae1 commit 1b19562

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

drivers/devfreq/tegra30-devfreq.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,15 @@ static int devm_tegra_devfreq_init_hw(struct device *dev,
821821
return err;
822822
}
823823

824+
static int tegra_devfreq_config_clks_nop(struct device *dev,
825+
struct opp_table *opp_table,
826+
struct dev_pm_opp *opp, void *data,
827+
bool scaling_down)
828+
{
829+
/* We want to skip clk configuration via dev_pm_opp_set_opp() */
830+
return 0;
831+
}
832+
824833
static int tegra_devfreq_probe(struct platform_device *pdev)
825834
{
826835
u32 hw_version = BIT(tegra_sku_info.soc_speedo_id);
@@ -830,6 +839,13 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
830839
unsigned int i;
831840
long rate;
832841
int err;
842+
const char *clk_names[] = { "actmon", NULL };
843+
struct dev_pm_opp_config config = {
844+
.supported_hw = &hw_version,
845+
.supported_hw_count = 1,
846+
.clk_names = clk_names,
847+
.config_clks = tegra_devfreq_config_clks_nop,
848+
};
833849

834850
tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL);
835851
if (!tegra)
@@ -874,13 +890,13 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
874890
return err;
875891
}
876892

877-
err = devm_pm_opp_set_supported_hw(&pdev->dev, &hw_version, 1);
893+
err = devm_pm_opp_set_config(&pdev->dev, &config);
878894
if (err) {
879-
dev_err(&pdev->dev, "Failed to set supported HW: %d\n", err);
895+
dev_err(&pdev->dev, "Failed to set OPP config: %d\n", err);
880896
return err;
881897
}
882898

883-
err = devm_pm_opp_of_add_table_noclk(&pdev->dev, 0);
899+
err = devm_pm_opp_of_add_table_indexed(&pdev->dev, 0);
884900
if (err) {
885901
dev_err(&pdev->dev, "Failed to add OPP table: %d\n", err);
886902
return err;

0 commit comments

Comments
 (0)