Skip to content

Commit

Permalink
OPP: Allow config_clks helper for single clk case
Browse files Browse the repository at this point in the history
There is a corner case with Tegra30, where we want to skip clk
configuration 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.

This is the easiest of the ways to make it work, without any special
hacks in the OPP core. Allow config_clks to be passed for single clk
case.

Tested-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
  • Loading branch information
vireshk committed Jul 12, 2022
1 parent 8174a3a commit 2f71ae1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/opp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,7 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev,
count = 1;

/* Fail early for invalid configurations */
if (!count || (config_clks && count == 1) || (!config_clks && count > 1))
if (!count || (!config_clks && count > 1))
return -EINVAL;

/* Another CPU that shares the OPP table has set the clkname ? */
Expand All @@ -2217,10 +2217,12 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev,
}

opp_table->clk_count = count;
opp_table->config_clks = config_clks;

/* Set generic single clk set here */
if (count == 1) {
opp_table->config_clks = _opp_config_clk_single;
if (!opp_table->config_clks)
opp_table->config_clks = _opp_config_clk_single;

/*
* We could have just dropped the "clk" field and used "clks"
Expand All @@ -2235,8 +2237,6 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev,
* too.
*/
opp_table->clk = opp_table->clks[0];
} else {
opp_table->config_clks = config_clks;
}

return 0;
Expand Down

0 comments on commit 2f71ae1

Please sign in to comment.