Commit 1b195626 authored by Viresh Kumar's avatar Viresh Kumar

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: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 2f71ae1a
...@@ -821,6 +821,15 @@ static int devm_tegra_devfreq_init_hw(struct device *dev, ...@@ -821,6 +821,15 @@ static int devm_tegra_devfreq_init_hw(struct device *dev,
return err; return err;
} }
static int tegra_devfreq_config_clks_nop(struct device *dev,
struct opp_table *opp_table,
struct dev_pm_opp *opp, void *data,
bool scaling_down)
{
/* We want to skip clk configuration via dev_pm_opp_set_opp() */
return 0;
}
static int tegra_devfreq_probe(struct platform_device *pdev) static int tegra_devfreq_probe(struct platform_device *pdev)
{ {
u32 hw_version = BIT(tegra_sku_info.soc_speedo_id); u32 hw_version = BIT(tegra_sku_info.soc_speedo_id);
...@@ -830,6 +839,13 @@ static int tegra_devfreq_probe(struct platform_device *pdev) ...@@ -830,6 +839,13 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
unsigned int i; unsigned int i;
long rate; long rate;
int err; int err;
const char *clk_names[] = { "actmon", NULL };
struct dev_pm_opp_config config = {
.supported_hw = &hw_version,
.supported_hw_count = 1,
.clk_names = clk_names,
.config_clks = tegra_devfreq_config_clks_nop,
};
tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL);
if (!tegra) if (!tegra)
...@@ -874,13 +890,13 @@ static int tegra_devfreq_probe(struct platform_device *pdev) ...@@ -874,13 +890,13 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
return err; return err;
} }
err = devm_pm_opp_set_supported_hw(&pdev->dev, &hw_version, 1); err = devm_pm_opp_set_config(&pdev->dev, &config);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to set supported HW: %d\n", err); dev_err(&pdev->dev, "Failed to set OPP config: %d\n", err);
return err; return err;
} }
err = devm_pm_opp_of_add_table_noclk(&pdev->dev, 0); err = devm_pm_opp_of_add_table_indexed(&pdev->dev, 0);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to add OPP table: %d\n", err); dev_err(&pdev->dev, "Failed to add OPP table: %d\n", err);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment