From: zwp Date: Sat, 20 Aug 2011 09:46:01 +0000 (-0700) Subject: phone-pad:phone-pad:battery bq27510 need to download firmware,but bq27541 don't need to, X-Git-Tag: firefly_0821_release~9770^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a3b85277fd30f51a226c1feaf98ab3bc483b547b;p=firefly-linux-kernel-4.4.55.git phone-pad:phone-pad:battery bq27510 need to download firmware,but bq27541 don't need to, when we use bq27541 ,download firmware of bq27510 will damage bq27541. so add a interface to check whether we need to download firmware. --- diff --git a/arch/arm/mach-rk29/board-rk29phonepadsdk.c b/arch/arm/mach-rk29/board-rk29phonepadsdk.c index 3f25a32e70ad..e9a79bc90ce0 100755 --- a/arch/arm/mach-rk29/board-rk29phonepadsdk.c +++ b/arch/arm/mach-rk29/board-rk29phonepadsdk.c @@ -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; } diff --git a/drivers/power/bq27510_battery.c b/drivers/power/bq27510_battery.c index 331d68d4568b..d8d3ef198618 100755 --- a/drivers/power/bq27510_battery.c +++ b/drivers/power/bq27510_battery.c @@ -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') diff --git a/drivers/power/bq27541_battery.c b/drivers/power/bq27541_battery.c index 8e8b2f8ec766..3b775fecda00 100755 --- a/drivers/power/bq27541_battery.c +++ b/drivers/power/bq27541_battery.c @@ -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')