On 11-01-16, 18:20, Stephen Boyd wrote:
@@ -241,9 +234,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) } priv->cpu_dev = cpu_dev;
- priv->cpu_reg = cpu_reg; policy->driver_data = priv;
- policy->clk = cpu_clk;
Maybe we can have an dev_pm_opp_get_rate() API and a cpufreq_generic_opp_get() so we can get rid of policy->clk usage in this driver?
I thought about this today and couldn't get to a sane solution. If we implement dev_pm_opp_get_rate(), then it should return the cached value of the currently programmed OPP. If the OPP isn't set yet, it can call clk_get_rate() and return that instead. But it doesn't make any sense to always call clk_get_rate() from dev_pm_opp_get_rate(), as that doesn't match its name.
OTOH, cpufreq really really needs a clk_get_rate() to happen, there can be cases where the clk is changed by some other entity, specially during suspend/resume and there are special checks in cpufreq about that.
We can surely add a patch later if we get answer to this, but for now, I will keep this patch as is.