From e0078135e80926605eb34625247afb0585193ba1 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Tue, 14 Feb 2012 07:46:50 +0100 Subject: 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 --- drivers/hwmon/lsm303dlh_a.c | 6 ++++++ drivers/hwmon/lsm303dlh_m.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/hwmon/lsm303dlh_a.c b/drivers/hwmon/lsm303dlh_a.c index b3cdd587e8d..aa152ada859 100644 --- a/drivers/hwmon/lsm303dlh_a.c +++ b/drivers/hwmon/lsm303dlh_a.c @@ -1101,6 +1101,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 b2a6feb4538..96bd6863d93 100644 --- a/drivers/hwmon/lsm303dlh_m.c +++ b/drivers/hwmon/lsm303dlh_m.c @@ -696,6 +696,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; } -- cgit v1.2.3