aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaga Radhesh <naga.radheshy@stericsson.com>2011-10-31 18:30:38 +0530
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-11-03 14:46:12 +0100
commit3e71fc9ee3d72c695cfb26143962eacb8906db20 (patch)
treeaed7b2ba2cc43bce3da597d272c04d1f52c0865f
parent86903ef07425d65590d14abca59079a58af71ca3 (diff)
hwmon:(lsm303dlh)enable X, Y and Z axis by defaultu8500-android-2.3_v4.30
Enable x,y and z axis bits of accelerometer, to read data from x,y and z axis. ST-Ericsson ID: 369951 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id:Ie8cdf30c210cd90520914b051c342050a80bf350 Signed-off-by: Naga Radhesh <naga.radheshy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35929 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/hwmon/lsm303dlh_a.c7
-rw-r--r--drivers/hwmon/lsm303dlhc_a.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/hwmon/lsm303dlh_a.c b/drivers/hwmon/lsm303dlh_a.c
index 4f58e2a75aa..d14468618ee 100644
--- a/drivers/hwmon/lsm303dlh_a.c
+++ b/drivers/hwmon/lsm303dlh_a.c
@@ -837,10 +837,15 @@ static ssize_t lsm303dlh_a_store_mode(struct device *dev,
data = lsm303dlh_a_read(ddata, CTRL_REG1, "CTRL_REG1");
+ /*
+ * If chip doesn't get reset during suspend/resume,
+ * x,y and z axis bits are getting cleared,so set
+ * these bits to get x,y,z axis data.
+ */
+ data |= LSM303DLH_A_CR1_AXIS_ENABLE;
data &= ~LSM303DLH_A_CR1_PM_MASK;
ddata->mode = val;
-
data |= ((val << LSM303DLH_A_CR1_PM_BIT) & LSM303DLH_A_CR1_PM_MASK);
error = lsm303dlh_a_write(ddata, CTRL_REG1, data, "CTRL_REG1");
diff --git a/drivers/hwmon/lsm303dlhc_a.c b/drivers/hwmon/lsm303dlhc_a.c
index 1c6d25f9b87..a8b1cd95fa9 100644
--- a/drivers/hwmon/lsm303dlhc_a.c
+++ b/drivers/hwmon/lsm303dlhc_a.c
@@ -400,6 +400,13 @@ static ssize_t lsm303dlhc_a_store_mode(struct device *dev,
data = lsm303dlhc_a_read(ddata, CTRL_REG1, "CTRL_REG1");
+ /*
+ * If chip doesn't get reset during suspend/resume,
+ * x,y and z axis bits are getting cleared,so set
+ * these bits to get x,y,z data.
+ */
+ data |= LSM303DLHC_A_CR1_AXIS_ENABLE;
+
data &= ~LSM303DLHC_A_CR1_MODE_MASK;
ddata->mode = val;