diff mbox

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

Message ID 1328697985-22504-2-git-send-email-ldewangan@nvidia.com
State Not Applicable, archived
Headers show

Commit Message

Laxman Dewangan Feb. 8, 2012, 10:46 a.m. UTC
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@nvidia.com>
---
 drivers/regulator/tps65910-regulator.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff mbox

Patch

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]);
 		/*