rk:pmu tps65910:set dcdc in pwm mode,and set dcdc in pfm mode when enter sleep
author张晴 <zhangqing@rock-chips.com>
Sat, 3 Nov 2012 02:20:12 +0000 (10:20 +0800)
committer张晴 <zhangqing@rock-chips.com>
Sat, 3 Nov 2012 02:20:12 +0000 (10:20 +0800)
arch/arm/mach-rk2928/board-rk2928-sdk-tps65910.c
arch/arm/mach-rk30/board-pmu-tps65910.c
arch/arm/mach-rk30/board-rk30-sdk-tps65910.c

index 43c24ce64675778291329b7a3c03240bb65c8ad5..e07bbe3e472cb77e787a30fe88fd232a1d6aab2d 100755 (executable)
@@ -188,6 +188,7 @@ int tps65910_pre_init(struct tps65910 *tps65910){
         }
        
        val  |= 0xff;
+       val  &= ~(0x07);   //set vdd1 vdd2 vio in pfm mode when in sleep
        err = tps65910_reg_write(tps65910, TPS65910_SLEEP_KEEP_RES_ON, val);
        if (err) {
                printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \
@@ -225,6 +226,22 @@ int tps65910_pre_init(struct tps65910 *tps65910){
        }
        #endif
        #endif
+
+       /**********************set arm in pwm ****************/
+         val = tps65910_reg_read(tps65910, TPS65910_DCDCCTRL);
+        if (val<0) {
+                printk(KERN_ERR "Unable to read TPS65910_DCDCCTRL reg\n");
+                return val;
+        }
+       
+       val &= ~(1<<4);
+       err = tps65910_reg_write(tps65910, TPS65910_DCDCCTRL, val);
+       if (err) {
+               printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \
+                               \n", TPS65910_VDIG1);
+               return err;
+       }       
+       /************************************************/
        
        printk("%s,line=%d\n", __func__,__LINE__);
        return 0;
index 41c72f96e9967ea6481819912339abbcaa4e6c3c..92db7c51175462febdcb98f0c173387283257df5 100755 (executable)
@@ -205,6 +205,7 @@ int tps65910_pre_init(struct tps65910 *tps65910){
         }
        
        val  |= 0xff;
+       val  &= ~(0x07);   //set vdd1 vdd2 vio in pfm mode when in sleep
        err = tps65910_reg_write(tps65910, TPS65910_SLEEP_KEEP_RES_ON, val);
        if (err) {
                printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \
@@ -241,6 +242,23 @@ int tps65910_pre_init(struct tps65910 *tps65910){
        }
        #endif
        #endif
+       
+       /**********************set arm in pwm ****************/
+         val = tps65910_reg_read(tps65910, TPS65910_DCDCCTRL);
+        if (val<0) {
+                printk(KERN_ERR "Unable to read TPS65910_DCDCCTRL reg\n");
+                return val;
+        }
+       
+       val &= ~(1<<4);
+       err = tps65910_reg_write(tps65910, TPS65910_DCDCCTRL, val);
+       if (err) {
+               printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \
+                               \n", TPS65910_VDIG1);
+               return err;
+       }       
+       /************************************************/
+       
        printk("%s,line=%d\n", __func__,__LINE__);
        return 0;
 
index d61ef3f69c3654acb0065adaad56003da432094f..56f86dcb14be4e3dd97295b8004d75e6adea979c 100755 (executable)
@@ -191,6 +191,7 @@ int tps65910_pre_init(struct tps65910 *tps65910){
         }
        
        val  |= 0xff;
+       val  &= ~(0x07);   //set vdd1 vdd2 vio in pfm mode when in sleep
        err = tps65910_reg_write(tps65910, TPS65910_SLEEP_KEEP_RES_ON, val);
        if (err) {
                printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \
@@ -227,6 +228,23 @@ int tps65910_pre_init(struct tps65910 *tps65910){
        }
        #endif
        #endif
+
+       /**********************set arm in pwm ****************/
+         val = tps65910_reg_read(tps65910, TPS65910_DCDCCTRL);
+        if (val<0) {
+                printk(KERN_ERR "Unable to read TPS65910_DCDCCTRL reg\n");
+                return val;
+        }
+       
+       val &= ~(1<<4);
+       err = tps65910_reg_write(tps65910, TPS65910_DCDCCTRL, val);
+       if (err) {
+               printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \
+                               \n", TPS65910_VDIG1);
+               return err;
+       }       
+       /************************************************/
+       
        printk("%s,line=%d\n", __func__,__LINE__);
        return 0;