rk3288:bq24296:modify bq24296 gpio unvalid
author张晴 <zhangqing@rock-chips.com>
Fri, 21 Mar 2014 03:33:21 +0000 (11:33 +0800)
committer张晴 <zhangqing@rock-chips.com>
Fri, 21 Mar 2014 03:33:21 +0000 (11:33 +0800)
arch/arm/boot/dts/rk3288-tb.dts
drivers/power/bq24296_charger.c

index b3de20aa3c115124d4a8f73ca1f9e77f1d5ec165..da3817afa128d5a0cb1ba025792a68541b25a7f4 100755 (executable)
        bq24296: bq24296@6b {
                compatible = "ti,bq24296";
                reg = <0x6b>;
-//             gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>;
+               gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>;
                bq24296,chg_current = <1000 500 2000>;
                status = "okay";
        };
index 0d110fd502717e7d3e16502964c6c491250af157..bd70bfb5dede1e39d71a947265ad04d25c2d9dc9 100755 (executable)
@@ -538,7 +538,7 @@ static int bq24296_battery_probe(struct i2c_client *client,const struct i2c_devi
        schedule_delayed_work(&di->usb_detect_work, 0);
        bq24296_init_registers();
 
-/*
+
        if (gpio_is_valid(pdev->chg_irq_pin)){
                irq = gpio_to_irq(pdev->chg_irq_pin);
                ret = request_threaded_irq(irq, NULL,chg_irq_func, IRQF_TRIGGER_FALLING| IRQF_ONESHOT, "bq24296_chg_irq", di);
@@ -548,7 +548,6 @@ static int bq24296_battery_probe(struct i2c_client *client,const struct i2c_devi
                        goto err_chgirq_failed;
                }
        }
-*/
 
        bq24296_int =1;
 
@@ -566,7 +565,10 @@ err_chgirq_failed:
 
 static void bq24296_battery_shutdown(struct i2c_client *client)
 {
+
+       if (gpio_is_valid(bq24296_pdata->chg_irq_pin)){
        free_irq(gpio_to_irq(bq24296_pdata->chg_irq_pin), NULL);
+       }
        
 }
 static int bq24296_battery_remove(struct i2c_client *client)