diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-23 18:22:22 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-27 21:51:02 -0800 |
commit | 8e12c04cd8a5061e98aba13d162cecb23215e4bb (patch) | |
tree | dcbc88eec61d29ffacfbfbebaafed923e0dbaae9 /drivers | |
parent | 80efe4d57a94a06930103432f84baf39eff55ff8 (diff) |
power: bq2419x: rewrite disable suspend option during charging
Cleanups and rewrite the option to disable suspend during
high current charging to make the option simple.
Change-Id: Ib30e01664f948ae844e6b8c293d0f4004b98c7ef
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/359388
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/bq2419x-charger.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/power/bq2419x-charger.c b/drivers/power/bq2419x-charger.c index 163a1bbea39f..dcd42a5d981c 100644 --- a/drivers/power/bq2419x-charger.c +++ b/drivers/power/bq2419x-charger.c @@ -357,15 +357,9 @@ static int bq2419x_set_charging_current(struct regulator_dev *rdev, goto error; battery_charging_status_update(bq2419x->bc_dev, bq2419x->chg_status); - if (bq2419x->disable_suspend_during_charging) { - if (bq2419x->cable_connected) { - if (in_current_limit > 500) - battery_charger_acquire_wake_lock - (bq2419x->bc_dev); - } else { - battery_charger_release_wake_lock(bq2419x->bc_dev); - } - } + if (bq2419x->disable_suspend_during_charging && + bq2419x->cable_connected && in_current_limit > 500) + battery_charger_acquire_wake_lock(bq2419x->bc_dev); return 0; error: dev_err(bq2419x->dev, "Charger enable failed, err = %d\n", ret); @@ -651,7 +645,6 @@ static irqreturn_t bq2419x_irq(int irq, void *data) bq2419x->chg_restart_time); if (bq2419x->disable_suspend_during_charging) battery_charger_release_wake_lock(bq2419x->bc_dev); - battery_charger_release_wake_lock(bq2419x->bc_dev); battery_charger_thermal_stop_monitoring( bq2419x->bc_dev); } @@ -670,7 +663,6 @@ static irqreturn_t bq2419x_irq(int irq, void *data) bq2419x->chg_restart_time); if (bq2419x->disable_suspend_during_charging) battery_charger_release_wake_lock(bq2419x->bc_dev); - battery_charger_release_wake_lock(bq2419x->bc_dev); } return IRQ_HANDLED; @@ -1120,7 +1112,6 @@ static struct bq2419x_platform_data *bq2419x_dt_parse(struct i2c_client *client) if (batt_reg_node) { int wdt_timeout; int chg_restart_time; - int disable_suspend_during_charging; int temp_polling_time; struct regulator_init_data *batt_init_data; const char *status_str; @@ -1142,13 +1133,10 @@ static struct bq2419x_platform_data *bq2419x_dt_parse(struct i2c_client *client) if (!batt_init_data) return ERR_PTR(-EINVAL); - disable_suspend_during_charging = + pdata->bcharger_pdata->disable_suspend_during_charging = of_property_read_bool(batt_reg_node, "ti,disbale-suspend-during-charging"); - pdata->bcharger_pdata->disable_suspend_during_charging - = disable_suspend_during_charging; - ret = of_property_read_u32(batt_reg_node, "watchdog-timeout", &wdt_timeout); if (!ret) |