Skip to content

Commit 2f71ae1

Browse files
committed
OPP: Allow config_clks helper for single clk case
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]>
1 parent 8174a3a commit 2f71ae1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/opp/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,7 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev,
21912191
count = 1;
21922192

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

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

22192219
opp_table->clk_count = count;
2220+
opp_table->config_clks = config_clks;
22202221

22212222
/* Set generic single clk set here */
22222223
if (count == 1) {
2223-
opp_table->config_clks = _opp_config_clk_single;
2224+
if (!opp_table->config_clks)
2225+
opp_table->config_clks = _opp_config_clk_single;
22242226

22252227
/*
22262228
* We could have just dropped the "clk" field and used "clks"
@@ -2235,8 +2237,6 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev,
22352237
* too.
22362238
*/
22372239
opp_table->clk = opp_table->clks[0];
2238-
} else {
2239-
opp_table->config_clks = config_clks;
22402240
}
22412241

22422242
return 0;

0 commit comments

Comments
 (0)