[PATCH V1 2/2] regulator: tps65910: Enable register caching of voltage controls.

From: Laxman Dewangan
Date: Wed Feb 08 2012 - 05:48:19 EST


Enabling the caching of the registers which is used for voltage
controls. By doing this, the modify_bits operation is faster as
it does not involve the i2c register read from device, just read
from cache. This results faster set voltage operation.

Signed-off-by: Laxman Dewangan <ldewangan@xxxxxxxxxx>
---
drivers/regulator/tps65910-regulator.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 9092b7f..3731d69 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1123,6 +1123,18 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
pmic->desc[i].ops = &tps65911_ops;
}

+ /* Enable register caching */
+ tps65910_enable_reg_cache(tps65910, pmic->get_ctrl_reg(i));
+ /* VDD1/VDD2/VDDCTRL-TPS65911 have SR and OP register */
+ if ((i == TPS65910_REG_VDD1) || (i == TPS65910_REG_VDD2) ||
+ ((tps65910_chip_id(tps65910) == TPS65911) &&
+ (i == TPS65911_REG_VDDCTRL))) {
+ tps65910_enable_reg_cache(tps65910,
+ pmic->get_ctrl_reg(i) + 1);
+ tps65910_enable_reg_cache(tps65910,
+ pmic->get_ctrl_reg(i) + 2);
+ }
+
err = tps65910_set_ext_sleep_config(pmic, i,
pmic_plat_data->regulator_ext_sleep_control[i]);
/*
--
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/