Skip to content

Commit

Permalink
cpufreq: imx6q: Set max suspend_freq to avoid changes during suspend
Browse files Browse the repository at this point in the history
If the cpufreq driver tries to modify voltage/freq during suspend/resume
it might need to control an external PMIC via I2C or SPI but those
devices might be already suspended. This issue is likely to happen
whenever the LDOs have their vin-supply set.

To avoid this scenario we just increase cpufreq to the maximum before
suspend.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Leonard Crestez authored and Rafael J. Wysocki committed Apr 19, 2017
1 parent 54cad2f commit 5aa1599
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/cpufreq/imx6q-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)

static int imx6q_cpufreq_init(struct cpufreq_policy *policy)
{
int ret;

policy->clk = arm_clk;
return cpufreq_generic_init(policy, freq_table, transition_latency);
ret = cpufreq_generic_init(policy, freq_table, transition_latency);
policy->suspend_freq = policy->max;

return ret;
}

static struct cpufreq_driver imx6q_cpufreq_driver = {
Expand All @@ -173,6 +178,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = {
.init = imx6q_cpufreq_init,
.name = "imx6q-cpufreq",
.attr = cpufreq_generic_attr,
.suspend = cpufreq_generic_suspend,
};

static int imx6q_cpufreq_probe(struct platform_device *pdev)
Expand Down

0 comments on commit 5aa1599

Please sign in to comment.