summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaga RADHESH Y <naga.radheshy@stericsson.com>2012-02-14 07:46:52 +0100
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-02-15 09:35:30 +0100
commit6321e7cfbff6e6fa46f122402f3f031b2d4f6dd5 (patch)
tree44033b619f9bcd9b413cf75c5e19edff8d2bef1c
parent20dd03e47a8b4ea55ec7e7a825f37c46ba171893 (diff)
hwmon:(lsm303dlh)enable X, Y and Z axis by default
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>
-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 aa152ada859..03158c29469 100644
--- a/drivers/hwmon/lsm303dlh_a.c
+++ b/drivers/hwmon/lsm303dlh_a.c
@@ -842,10 +842,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;