From: 张晴 <zhangqing@rock-chips.com>
Date: Thu, 14 Mar 2013 03:47:26 +0000 (+0800)
Subject: tps65910:set dcdc time step 12.5mv/us
X-Git-Tag: firefly_0821_release~7411
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8283fc01e898c77be6a61814dc8c87b3ddbbaba1;p=firefly-linux-kernel-4.4.55.git

tps65910:set dcdc time step 12.5mv/us
---

diff --git a/arch/arm/mach-rk30/board-pmu-tps65910.c b/arch/arm/mach-rk30/board-pmu-tps65910.c
index 75c1510bf450..ede21b277e56 100755
--- a/arch/arm/mach-rk30/board-pmu-tps65910.c
+++ b/arch/arm/mach-rk30/board-pmu-tps65910.c
@@ -92,7 +92,8 @@ int tps65910_pre_init(struct tps65910 *tps65910){
 	}
 
 	val |= (1<<5);		//when 1: 1.5 A
-	val |= (0x07<<2);	//TSTEP[2:0] = 111 : 2.5 mV/¦Ìs(sampling 3 Mhz/5)
+	val &= (~(0x3 <<2));
+	val |= (0x01<<2);	//TSTEP[3:2] = 01 : 12.5 mV/us(sampling 3 Mhz)
 	err = tps65910_reg_write(tps65910, TPS65910_VDD1, val);
 	if (err) {
 		printk(KERN_ERR "Unable to write TPS65910_VDD1 reg\n");
@@ -107,6 +108,8 @@ int tps65910_pre_init(struct tps65910 *tps65910){
 	}
 
 	val |= (1<<5);		//when 1: 1.5 A
+	val &= (~(0x3 <<2));
+	val |= (0x01<<2);	//TSTEP[3:2] = 01 : 12.5 mV/us(sampling 3 Mhz)
 	err = tps65910_reg_write(tps65910, TPS65910_VDD2, val);
 	if (err) {
 		printk(KERN_ERR "Unable to write TPS65910_VDD2 reg\n");
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 22e06e2cb98e..88effd49700f 100755
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -936,7 +936,7 @@ static int tps65910_set_voltage_dcdc_time_sel(struct regulator_dev *dev,
 	switch (id) {
 	case TPS65910_REG_VDD1:
 	case TPS65910_REG_VDD2:
-		return DIV_ROUND_UP(abs(old_volt - new_volt), 12500);
+		return DIV_ROUND_UP(abs(old_volt - new_volt)*2, 12500);
 	case TPS65911_REG_VDDCTRL:
 		return DIV_ROUND_UP(abs(old_volt - new_volt), 5000);
 	}