summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Wallin <mattias.wallin@stericsson.com>2011-05-05 10:28:24 +0200
committerHenrik Aberg <henrik.aberg@stericsson.com>2011-05-18 09:40:12 +0200
commita17957747d55c08855d45579041181e9c24e8143 (patch)
treec8a4a518cd32e806c4d958c13866a50dbc6290bd
parentc1eeae50e420c6106f02da4e40f6c059dba1d195 (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 28cbc2aed42..3ffa3132264 100644
--- a/drivers/input/misc/ab8500-accdet.c
+++ b/drivers/input/misc/ab8500-accdet.c
@@ -1274,6 +1274,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)
{
@@ -1285,6 +1287,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;
}
@@ -1294,6 +1307,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);