MLK-9693 cpufreq: imx: increase cpufreq during suspend/resume
authorBai Ping <b51503@freescale.com>
Wed, 15 Oct 2014 01:04:02 +0000 (09:04 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:39 +0000 (14:48 -0500)
commit6871852cae5428d4d7759cc888501ccacdaebeaa
tree269d2972f49383d32e17f99d9168ab12f408b5de
parent054b019c789430d10ea3d33f665b6e92514825ed
MLK-9693 cpufreq: imx: increase cpufreq during suspend/resume

During suspend/ressume, when cpufreq driver try to increase
Voltage/freq, it needs to control I2C/SPI to communicate with
external PMIC to adjust voltage, but these I2C/SPI devices may
be already suspended, to avoid such scenario, we adjust increase
cpufreq to highest setpoint before suspend.

As this pm notification's updating cpu policy may work together
with cpufreq governor, both of them may call set_target at same
time, so we need to add mutex lock to prevent this scenario,
otherwise, the clock use count will be wrong.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit 9f5158fd0fd6e11e2f69cf975d3843cf6cc84048)
drivers/cpufreq/imx6q-cpufreq.c