summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2012-02-14 07:46:48 +0100
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-02-14 16:02:55 +0100
commit94c3dc6d32e66edc167ac682cdd25df547e181a4 (patch)
treeb8602272f00f1dae13d13ec053591a8556f95b17
parent166ac2965c83c978a558224fb10e18e9ba223a1e (diff)
lsm303dlh: add support for Android early suspend
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
-rw-r--r--drivers/hwmon/lsm303dlh_a.c3
-rw-r--r--drivers/hwmon/lsm303dlh_m.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/lsm303dlh_a.c b/drivers/hwmon/lsm303dlh_a.c
index d3c30bc49e0..d2494a66a35 100644
--- a/drivers/hwmon/lsm303dlh_a.c
+++ b/drivers/hwmon/lsm303dlh_a.c
@@ -37,6 +37,7 @@
#endif
#include <linux/lsm303dlh.h>
+#include <linux/earlysuspend.h>
#include <linux/regulator/consumer.h>
/* lsm303dlh accelerometer registers */
@@ -197,6 +198,7 @@ struct lsm303dlh_a_data {
unsigned char interrupt_configure[2];
unsigned char interrupt_duration[2];
unsigned char interrupt_threshold[2];
+ struct early_suspend early_suspend;
int device_status;
int id;
};
@@ -287,6 +289,7 @@ static int lsm303dlh_a_restore(struct lsm303dlh_a_data *ddata)
if (ddata->regulator)
regulator_enable(ddata->regulator);
+
/* BDU should be enabled by default/recommened */
reg = ddata->range;
reg |= LSM303DLH_A_CR4_BDU_MASK;
diff --git a/drivers/hwmon/lsm303dlh_m.c b/drivers/hwmon/lsm303dlh_m.c
index aa43d055e67..d82f765adf2 100644
--- a/drivers/hwmon/lsm303dlh_m.c
+++ b/drivers/hwmon/lsm303dlh_m.c
@@ -38,6 +38,7 @@
#include <linux/lsm303dlh.h>
#include <linux/regulator/consumer.h>
+#include <linux/earlysuspend.h>
#include <linux/kernel.h>
/* lsm303dlh magnetometer registers */
@@ -160,6 +161,7 @@ struct lsm303dlh_m_data {
unsigned char mode;
unsigned char rate;
unsigned char range;
+ struct early_suspend early_suspend;
int device_status;
};