summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortryout_chen <tryout_chen@asus.com>2012-11-15 14:32:21 +0800
committerAndroid Partner Code Review <android-gerrit-partner@google.com>2012-11-29 10:18:55 -0800
commit05b777c19883248ea341945a243ddb64859cd3e7 (patch)
tree62264cf809ada4fa7d5a8ceefe7c59f27364c0b9
parent8722d5e9b3d4bc96d433148d05334823631a645b (diff)
downloadtegra-android-tegra3-grouper-3.1-jb-mr1.1.tar.gz
Proximity: Enable sensor by it's previous RIL setting when device resume from suspend.android-tegra3-grouper-3.1-jb-mr1.1
Change-Id: Id5b0bfaa79d62e5c41fa704470cf82bf7a0fefac
-rw-r--r--drivers/input/proximity/cap1106.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/proximity/cap1106.c b/drivers/input/proximity/cap1106.c
index c78299616e82..570a18fac7d6 100644
--- a/drivers/input/proximity/cap1106.c
+++ b/drivers/input/proximity/cap1106.c
@@ -72,6 +72,7 @@ static int prev_c6_status = 0;
static int c2_acc_cnt = 0;
static int c6_acc_cnt = 0;
static int acc_limit = 10;
+static int force_enable = 1;
/*----------------------------------------------------------------------------
** FUNCTION DECLARATION
@@ -472,6 +473,7 @@ static ssize_t store_sensor_onoff(struct device *dev, struct device_attribute *a
return -EINVAL;
mutex_lock(&prox_mtx);
+ force_enable = enable;
cap1106_enable_sensor(client, enable);
mutex_unlock(&prox_mtx);
@@ -892,7 +894,8 @@ static int cap1106_resume(struct i2c_client *client)
{
PROX_DEBUG("+\n");
mutex_lock(&prox_mtx);
- cap1106_enable_sensor(client, 1);
+ if (force_enable)
+ cap1106_enable_sensor(client, 1);
mutex_unlock(&prox_mtx);
PROX_DEBUG("-\n");
return 0;