From: 张晴 Date: Fri, 21 Mar 2014 03:33:21 +0000 (+0800) Subject: rk3288:bq24296:modify bq24296 gpio unvalid X-Git-Tag: firefly_0821_release~5937 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cce17ad8a7a3723ae3100fa915fd33d63c6f742b;p=firefly-linux-kernel-4.4.55.git rk3288:bq24296:modify bq24296 gpio unvalid --- diff --git a/arch/arm/boot/dts/rk3288-tb.dts b/arch/arm/boot/dts/rk3288-tb.dts index b3de20aa3c11..da3817afa128 100755 --- a/arch/arm/boot/dts/rk3288-tb.dts +++ b/arch/arm/boot/dts/rk3288-tb.dts @@ -199,7 +199,7 @@ 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"; }; diff --git a/drivers/power/bq24296_charger.c b/drivers/power/bq24296_charger.c index 0d110fd50271..bd70bfb5dede 100755 --- a/drivers/power/bq24296_charger.c +++ b/drivers/power/bq24296_charger.c @@ -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)