summaryrefslogtreecommitdiff
path: root/drivers/hwmon/lsm303dlhc_a.c
diff options
context:
space:
mode:
authorNaga Radhesh <naga.radheshy@stericsson.com>2011-10-31 18:30:38 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:09 +0200
commit91f25d6ed091a20af26c337e15aaec417788fefd (patch)
treec20b63b2d779c9b7bbf86fbeab705d03b7959c3c /drivers/hwmon/lsm303dlhc_a.c
parent311a1d5209b0a5d660ce6e485d61b8df224a1d6f (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> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35929 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/hwmon/lsm303dlhc_a.c')
-rw-r--r--drivers/hwmon/lsm303dlhc_a.c7
1 files changed, 7 insertions, 0 deletions
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;