summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Wallin <mattias.wallin@stericsson.com>2011-05-05 10:28:24 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:03:32 +0200
commit0bb8f1bf104462cbb1749e67013258d1c6bc2df4 (patch)
tree015ca82d8b99677a4d03960220516169b193d32a
parent9cfc3a2be1d4ce9cf7e7e488124998bd5696eea7 (diff)
input: ab8500-accdetect suspend modification
This patch disable the AccDetect comparator and pull-up in supend to save 100uA idle current. The comparator and pull-up is restored in resume. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> ST-Ericsson ID: 335994 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: na Change-Id: I81be240d06731e828f435eab9c967776c7cd00e7 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/22395 Reviewed-by: QATOOLS Tested-by: Mattias WALLIN <mattias.wallin@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r--drivers/input/misc/ab8500-accdet.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/input/misc/ab8500-accdet.c b/drivers/input/misc/ab8500-accdet.c
index 77634d51c7a..837bb304d4d 100644
--- a/drivers/input/misc/ab8500-accdet.c
+++ b/drivers/input/misc/ab8500-accdet.c
@@ -1273,6 +1273,8 @@ static int __devexit ab8500_acc_detect_remove(struct platform_device *pdev)
}
#if defined(CONFIG_PM)
+static u8 acc_det_ctrl_suspend_val;
+
static int ab8500_acc_detect_suspend(struct platform_device *pdev,
pm_message_t state)
{
@@ -1284,6 +1286,17 @@ static int ab8500_acc_detect_suspend(struct platform_device *pdev,
cancel_delayed_work_sync(&dd->detect_work);
cancel_delayed_work_sync(&dd->init_work);
+ /* Turn off AccDetect comparators and pull-up */
+ (void) abx500_get_register_interruptible(
+ &dd->pdev->dev,
+ AB8500_ECI_AV_ACC,
+ AB8500_ACC_DET_CTRL_REG,
+ &acc_det_ctrl_suspend_val);
+ (void) abx500_set_register_interruptible(
+ &dd->pdev->dev,
+ AB8500_ECI_AV_ACC,
+ AB8500_ACC_DET_CTRL_REG,
+ 0);
return 0;
}
@@ -1293,6 +1306,13 @@ static int ab8500_acc_detect_resume(struct platform_device *pdev)
dev_dbg(&dd->pdev->dev, "%s: Enter\n", __func__);
+ /* Turn on AccDetect comparators and pull-up */
+ (void) abx500_set_register_interruptible(
+ &dd->pdev->dev,
+ AB8500_ECI_AV_ACC,
+ AB8500_ACC_DET_CTRL_REG,
+ acc_det_ctrl_suspend_val);
+
/* After resume, reinitialize */
dd->gpio35_dir_set = dd->accdet1_th_set = dd->accdet2_th_set = 0;
queue_delayed_work(dd->irq_work_queue, &dd->init_work, 0);