summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-10-11 17:21:46 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:09 +0200
commit8a5e1d02337f18783802fc5d7dcf668b534be5de (patch)
tree6587c4e2de35c30d7ad6fa73e2e1ece3b3d2ff6d
parent945dcdf5c9fd7e2406efd69de71d6ac6b0c1505b (diff)
hwmon: lsm303dlh: use regulator_set_optimum_mode()
Inform the regulator framework about the current consumption, to be used with DRMS. Note that the current consumption in sleep modes is much lower, but we do not inform the regulator framework about those for now. ST-Ericsson ID: 366715 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I52b9162eead0091595b731e34ebca3bfc4d3d9be Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34436 Reviewed-by: QATOOLS Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com> Reviewed-by: Naga RADHESH Y <naga.radheshy@stericsson.com>
-rw-r--r--drivers/hwmon/lsm303dlh_a.c6
-rw-r--r--drivers/hwmon/lsm303dlh_m.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hwmon/lsm303dlh_a.c b/drivers/hwmon/lsm303dlh_a.c
index 65e92dfb0ff..c723cfee11e 100644
--- a/drivers/hwmon/lsm303dlh_a.c
+++ b/drivers/hwmon/lsm303dlh_a.c
@@ -1094,6 +1094,12 @@ static int __devinit lsm303dlh_a_probe(struct i2c_client *client,
}
if (ddata->regulator) {
+ /*
+ * 0.83 milliamps typical with magnetic sensor setting ODR =
+ * 7.5 Hz, Accelerometer sensor ODR = 50 Hz. Double for
+ * safety.
+ */
+ regulator_set_optimum_mode(ddata->regulator, 830 * 2);
regulator_enable(ddata->regulator);
ddata->device_status = DEVICE_ON;
}
diff --git a/drivers/hwmon/lsm303dlh_m.c b/drivers/hwmon/lsm303dlh_m.c
index 98704dc5a0b..5ade20cea97 100644
--- a/drivers/hwmon/lsm303dlh_m.c
+++ b/drivers/hwmon/lsm303dlh_m.c
@@ -690,6 +690,12 @@ static int __devinit lsm303dlh_m_probe(struct i2c_client *client,
}
if (ddata->regulator) {
+ /*
+ * 0.83 milliamps typical with magnetic sensor setting ODR =
+ * 7.5 Hz, Accelerometer sensor ODR = 50 Hz. Double for
+ * safety.
+ */
+ regulator_set_optimum_mode(ddata->regulator, 830 * 2);
regulator_enable(ddata->regulator);
ddata->device_status = DEVICE_ON;
}