summaryrefslogtreecommitdiff
path: root/drivers/mxc/thermal
diff options
context:
space:
mode:
authorRong Dian <b38775@freescale.com>2012-08-20 20:23:00 +0800
committerRong Dian <b38775@freescale.com>2012-08-21 14:46:17 +0800
commit1d80bd0d43df0561cf64d062a501aabe8a9cd44f (patch)
tree30f34599e1c3e6ad01f660d9e3c3e089fdd8e68f /drivers/mxc/thermal
parent30b0b3d67d251ebaf916b2463cc8eda479ef5758 (diff)
ENGR00220794 imx6 thermal: add suspend and resume for thermal_sys class
1.Avoiding system wrong reboot caused by error temperature without cancel_delayed_work before entering into suspend,so to cancel thermal_zone_device temperature polling temperature delayed_work before entering into suspend, reenable polling temperature delayed_work after entering into resume. 2.In anatop_thermal_suspend, turn off alarm firstly Signed-off-by: Rong Dian <b38775@freescale.com>
Diffstat (limited to 'drivers/mxc/thermal')
-rw-r--r--drivers/mxc/thermal/thermal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mxc/thermal/thermal.c b/drivers/mxc/thermal/thermal.c
index d66db054979a..0f4cfb8304ce 100644
--- a/drivers/mxc/thermal/thermal.c
+++ b/drivers/mxc/thermal/thermal.c
@@ -959,6 +959,9 @@ static int anatop_thermal_remove(struct platform_device *pdev)
static int anatop_thermal_suspend(struct platform_device *pdev,
pm_message_t state)
{
+ /* turn off alarm */
+ anatop_update_alarm(0);
+ suspend_flag = true;
/* Power down anatop thermal sensor */
__raw_writel(BM_ANADIG_TEMPSENSE0_MEASURE_TEMP,
anatop_base + HW_ANADIG_TEMPSENSE0_CLR);
@@ -968,10 +971,6 @@ static int anatop_thermal_suspend(struct platform_device *pdev,
anatop_base + HW_ANADIG_TEMPSENSE0_SET);
__raw_writel(BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF,
anatop_base + HW_ANADIG_ANA_MISC0_CLR);
- /* turn off alarm */
- anatop_update_alarm(0);
- suspend_flag = true;
-
return 0;
}
static int anatop_thermal_resume(struct platform_device *pdev)