ricoh619:ricoh619 pmu modify set mode and init reg
author张晴 <zhangqing@rock-chips.com>
Sat, 8 Jun 2013 06:25:54 +0000 (14:25 +0800)
committer张晴 <zhangqing@rock-chips.com>
Sat, 8 Jun 2013 06:25:54 +0000 (14:25 +0800)
arch/arm/mach-rk30/board-pmu-ricoh619.c
drivers/mfd/ricoh619.c [changed mode: 0644->0755]
drivers/regulator/ricoh619-regulator.c
include/linux/mfd/ricoh619.h

index 851c58a416fefda874c89c7ffe14925bb244b296..32e2ca4bbd64602b6226c667cf0cd11ce75e47b2 100755 (executable)
@@ -17,7 +17,6 @@ static int ricoh619_pre_init(struct ricoh619 *ricoh619){
 
        Ricoh619 =      ricoh619;
        printk("%s,line=%d\n", __func__,__LINE__);      
-       uint8_t cont;
        int ret;
 
        ret = ricoh619_set_bits(ricoh619->dev,RICOH619_PWR_REP_CNT,(1 << 0));  //set restart when power off
@@ -25,7 +24,17 @@ static int ricoh619_pre_init(struct ricoh619 *ricoh619){
        /**********set dcdc mode when in sleep mode **************/
        
        /*****************************************************/
+       
+      /****************set Re-charging voltage*****************/
+       ret = ricoh619_set_bits(ricoh619->dev,BATSET2_REG,(3 << 0)); 
+       ret = ricoh619_clr_bits(ricoh619->dev,BATSET2_REG,(1 << 2)); //set vrchg 4v
+       /*****************************************************/
+       
+       /****************set dcdc & ldo on or off when in sleep******/
+//     ret = ricoh619_clr_bits(ricoh619->dev,RICOH_DC1_SLOT,(0xf << 0)); 
 
+//     ret = ricoh619_clr_bits(ricoh619->dev,RICOH_LDO1_SLOT,(0xf << 0)); 
+       /*****************************************************/
        return 0;
   }
 static int ricoh619_post_init(struct ricoh619 *ricoh619)
old mode 100644 (file)
new mode 100755 (executable)
index 59fc502..83dd730
@@ -700,7 +700,7 @@ static int ricoh619_i2c_probe(struct i2c_client *client,
        mutex_init(&ricoh619->io_lock);
 
        ret = ricoh619_read(ricoh619->dev, 0x36, &control);
-       if ((control < 0) || (control == 0xff)) {
+       if ((control < 0) || (control == 0x00)) {
                printk(KERN_INFO "The device is not ricoh619\n");
                return 0;
        }
index 3c5d433127b13a768b22d02c936649bbb90e7963..5502d87f1042a3d64648fc915ea276ba5116143a 100644 (file)
@@ -303,11 +303,11 @@ static int ricoh619_dcdc_set_mode(struct regulator_dev *rdev, unsigned int mode)
        switch(mode)
        {
        case REGULATOR_MODE_FAST:
-               return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xef) | 0x10));
+               return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xcf) | 0x10));
        case REGULATOR_MODE_NORMAL:
                return ricoh619_write(parent, ri->reg_en_reg, (control & 0xcf));
        case REGULATOR_MODE_STANDBY:
-               return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xdf) | 0x20));       
+               return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xcf) | 0x20));       
        default:
                printk("error:pmu_619 only powersave pwm psm mode\n");
                return -EINVAL;
index 627a607c45a78cacf9cbe72bd1d6029d6c8d0c82..8d946414a42f30d7477d8528098c4f8c588e30bf 100644 (file)
 #define        RICOH619_FG_CTRL                0xE0
 #define        RICOH619_PSWR                   0x07
 
+#define RICOH_DC1_SLOT 0x16
+#define RICOH_DC2_SLOT 0x17
+#define RICOH_DC3_SLOT 0x18
+#define RICOH_DC4_SLOT 0x19
+#define RICOH_DC5_SLOT 0x1a
+
+#define RICOH_LDO1_SLOT 0x1b
+#define RICOH_LDO2_SLOT 0x1c
+#define RICOH_LDO3_SLOT 0x1d
+#define RICOH_LDO4_SLOT 0x1e
+#define RICOH_LDO5_SLOT 0x1f
+#define RICOH_LDO6_SLOT 0x20
+#define RICOH_LDO7_SLOT 0x21
+#define RICOH_LDO8_SLOT 0x22
+#define RICOH_LDO9_SLOT 0x23
+#define RICOH_LDO10_SLOT 0x24
+
+
+
 /* RICOH619 IRQ definitions */
 enum {
        RICOH619_IRQ_POWER_ON,