summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Qiu <joqiu@nvidia.com>2012-02-29 18:08:32 +0800
committerSimone Willett <swillett@nvidia.com>2012-02-29 17:06:29 -0800
commit1579d6096c14765e8f1dce2a0ac1a732db944d0b (patch)
treeb690b8b304e55c37ca43a51bfdc514cc8f5bf0cd
parent7401ece5369ddf4b780b207171e89902348e66ae (diff)
input: misc: cm3217: Fix incorrect enabling during suspend/resume
Bug 946800 Change-Id: I1c7665002c94f54eb44c6b0715f6bd737a3e1288 Signed-off-by: Johnny Qiu <joqiu@nvidia.com> Reviewed-on: http://git-master/r/86572 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Kerwin Wan <kerwinw@nvidia.com>
-rw-r--r--drivers/input/misc/cm3217.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/misc/cm3217.c b/drivers/input/misc/cm3217.c
index f6dc7e58eb17..9c9b60d69619 100644
--- a/drivers/input/misc/cm3217.c
+++ b/drivers/input/misc/cm3217.c
@@ -55,6 +55,7 @@ struct cm3217_info {
struct workqueue_struct *lp_wq;
int als_enable;
+ int als_enabled_before_suspend;
uint16_t *adc_table;
uint16_t cali_table[10];
int irq;
@@ -871,6 +872,7 @@ static void cm3217_early_suspend(struct early_suspend *h)
D("[LS][CM3217] %s\n", __func__);
+ lpi->als_enabled_before_suspend = lpi->als_enable;
if (lpi->als_enable)
lightsensor_disable(lpi);
}
@@ -881,7 +883,7 @@ static void cm3217_late_resume(struct early_suspend *h)
D("[LS][CM3217] %s\n", __func__);
- if (!lpi->als_enable)
+ if (lpi->als_enabled_before_suspend)
lightsensor_enable(lpi);
}
@@ -1021,6 +1023,7 @@ static int cm3217_probe(struct i2c_client *client,
register_early_suspend(&lpi->early_suspend);
lpi->als_enable = 0;
+ lpi->als_enabled_before_suspend = 0;
D("[CM3217] %s: Probe success!\n", __func__);
return ret;