phone-pad:phone-pad:battery bq27510 need to download firmware,but bq27541 don't need to,
authorzwp <zwp@rock-chips.com>
Sat, 20 Aug 2011 09:46:01 +0000 (02:46 -0700)
committer张文平 <zwp@rk29.(none)>
Tue, 23 Aug 2011 08:09:54 +0000 (16:09 +0800)
when we use bq27541 ,download firmware of bq27510 will damage bq27541.
so add a interface to check whether we need to download firmware.

arch/arm/mach-rk29/board-rk29phonepadsdk.c
drivers/power/bq27510_battery.c
drivers/power/bq27541_battery.c

index 3f25a32e70adee651c0f52554b2ad30b6e8970cb..e9a79bc90ce0b9b14b563faa130235a61f735b5a 100755 (executable)
@@ -563,7 +563,7 @@ void laibao_reset(void)
 }
 void laibao_hold(void)
 {
-    printk("nas_hold()\n");
+    printk("laibao_hold()\n");
     gpio_direction_output(TOUCH_RESET_PIN, 0);
     msleep(5);
     gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
@@ -573,14 +573,14 @@ void laibao_request_io(void)
 {
     if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
       gpio_free(TOUCH_RESET_PIN);
-      printk("nas_init_platform_hw gpio_request error\n");
+      printk("laibao_request_io gpio_request error\n");
       return ;
     }
 
     if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
       gpio_free(TOUCH_INT_PIN);
          gpio_free(TOUCH_RESET_PIN);
-      printk("nas_init_platform_hw gpio_request error\n");
+      printk("laibao_request_io gpio_request error\n");
       return ;
     }
 }
@@ -593,7 +593,7 @@ int laibao_init_platform_hw(void)
        
     if(gpio_request(RK29_PIN6_PD3,NULL) != 0){
       gpio_free(RK29_PIN6_PD3);
-      printk("mma8452_init_platform_hw gpio_request error\n");
+      printk("laibao_init_platform_hw gpio_request error\n");
       return -EIO;
     }
        
index 331d68d4568b260420d5b9a3a567b5447d75c373..d8d3ef19861873c7412253d71bcdbbe159746aea 100755 (executable)
@@ -102,6 +102,12 @@ static ssize_t battery_proc_write(struct file *file,const char __user *buffer,
        rc = get_user(c,buffer);
        if(rc)
                return rc;
+       
+       //added by zwp,c='8' means check whether we need to download firmware to bq27xxx,return 0 means yes.
+       if(c == '8'){
+               printk("%s,bq27510 need to download firmware\n",__FUNCTION__);
+       }
+       
        if(c == '1')
                virtual_battery_enable = 1;
        else if(c == '2')
index 8e8b2f8ec766e07377f084401c9778f57816ec30..3b775fecda00925f84201060279f15144e352473 100755 (executable)
@@ -108,6 +108,12 @@ static ssize_t battery_proc_write(struct file *file,const char __user *buffer,
        rc = get_user(c,buffer);
        if(rc)
                return rc;
+       
+       //added by zwp,c='8' means check whether we need to download firmware to bq27xxx,return 0 means yes.
+       if(c == '8'){
+               printk("%s,bq27541 don't need to download firmware\n",__FUNCTION__);
+               return -1;//bq27541 don't need to download firmware.
+       }
        if(c == '1')
                virtual_battery_enable = 1;
        else if(c == '2')