aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorMarkus Helgesson <markus.helgesson@stericsson.com>2011-02-24 10:39:54 +0100
committerJonas ABERG <jonas.aberg@stericsson.com>2011-03-01 10:35:16 +0100
commit0cf2b4c630fdde06fee5bf240bbf47aff19b093e (patch)
tree728cf4650df111e0e57d833e900d5e2239e20951 /drivers/power
parent4f0e428f1cafd2f4fcc01dbff39c9b89414523e6 (diff)
power: ab8500_bm: Cancel temperature measurement in suspend
ab8500_temp uses a periodic timer for doing temperature measurements. Before entering suspend the timer needs to be cancelled and started again when resuming. The periodic check is not needed during suspend since the AB will trigger an IRQ if the temperature becomes too high. Also removed the delay for when the first measurement is done since it is no longer needed and can cause problems if we enter suspend before the measurement has been done. ST-Ericsson Linux next: Not tested ST-Ericsson ID: WP 325418 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ib7376ccfa492bb6ec81b46ca6af01017a9eee8c0 Signed-off-by: Markus Helgesson <markus.helgesson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/16870 Reviewed-by: Johan PALSSON <johan.palsson@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/ab8500_btemp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index 9a814f7d470..c9125cb8221 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -658,11 +658,9 @@ static void ab8500_btemp_periodic(struct ab8500_btemp *di,
enable);
if (enable)
- queue_delayed_work(di->btemp_wq,
- &di->btemp_periodic_work,
- HZ);
+ queue_delayed_work(di->btemp_wq, &di->btemp_periodic_work, 0);
else
- cancel_delayed_work(&di->btemp_periodic_work);
+ cancel_delayed_work_sync(&di->btemp_periodic_work);
}
/**
@@ -870,7 +868,10 @@ static struct ab8500_btemp_interrupts ab8500_btemp_irq[] = {
#if defined(CONFIG_PM)
static int ab8500_btemp_resume(struct platform_device *pdev)
{
- /* TODO: Do the appropriate here */
+ struct ab8500_btemp *di = platform_get_drvdata(pdev);
+
+ if (di->events.ac_conn || di->events.usb_conn)
+ ab8500_btemp_periodic(di, true);
return 0;
}
@@ -878,7 +879,10 @@ static int ab8500_btemp_resume(struct platform_device *pdev)
static int ab8500_btemp_suspend(struct platform_device *pdev,
pm_message_t state)
{
- /* TODO: Do the appropriate here */
+ struct ab8500_btemp *di = platform_get_drvdata(pdev);
+
+ if (di->events.ac_conn || di->events.usb_conn)
+ ab8500_btemp_periodic(di, false);
return 0;
}