summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/imx6q-cpufreq.c
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2017-04-04 20:04:12 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-04-19 23:22:01 +0200
commit5aa1599ff039a68a5c43e9aa74973f40b1065746 (patch)
treef22f034b46d8657aea8dafae29b4734f9b09f831 /drivers/cpufreq/imx6q-cpufreq.c
parent54cad2fce71f3ed2995bfc6d17d4ea5c898f20b1 (diff)
downloadtalos-obmc-linux-5aa1599ff039a68a5c43e9aa74973f40b1065746.tar.gz
talos-obmc-linux-5aa1599ff039a68a5c43e9aa74973f40b1065746.zip
cpufreq: imx6q: Set max suspend_freq to avoid changes during suspend
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>
Diffstat (limited to 'drivers/cpufreq/imx6q-cpufreq.c')
-rw-r--r--drivers/cpufreq/imx6q-cpufreq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index be90ee3810bf..786122e0455e 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -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 = {
@@ -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)
OpenPOWER on IntegriCloud