summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorsiddardha naraharisetti <siddardhan@nvidia.com>2014-04-07 19:21:58 -0700
committerRiham Haidar <rhaidar@nvidia.com>2014-05-05 11:07:22 -0700
commitef9d1461243b13707504e64c386a34e1a75364d4 (patch)
tree33e06ff5e6a4a9430972dfc58959f31f2e5dc344 /drivers/power
parentc4bcc17708f01f4368ea16b6ba7454e0055355f6 (diff)
power: bq2419x: add different time for power on after charge complete shutdown
If high charging source is connected and system goes to shutdown after full charging of battery then system can be stay on power off for longer time. Add different auto recharge time for power off state. Bug 1489717 Change-Id: Iaf1c8721eef70b7c51c2b5bf0ba3c1a082995456 Signed-off-by: siddardha naraharisetti <siddardhan@nvidia.com> Reviewed-on: http://git-master/r/393183 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Change-Id: I9a7d42737dfc748cbc79efc1abc5bca03e3e8a80 Reviewed-on: http://git-master/r/404464 Reviewed-by: Riham Haidar <rhaidar@nvidia.com> Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/bq2419x-charger.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/power/bq2419x-charger.c b/drivers/power/bq2419x-charger.c
index 42c432544306..04e4e1058a6e 100644
--- a/drivers/power/bq2419x-charger.c
+++ b/drivers/power/bq2419x-charger.c
@@ -79,6 +79,7 @@ struct bq2419x_chip {
int gpio_otg_iusb;
int wdt_refresh_timeout;
int wdt_time_sec;
+ int auto_recharge_time_power_off;
bool emulate_input_disconnected;
struct mutex mutex;
@@ -1263,6 +1264,7 @@ static struct bq2419x_platform_data *bq2419x_dt_parse(struct i2c_client *client)
int temp_range_len, chg_current_lim_len, chg_voltage_lim_len;
int wdt_timeout;
int chg_restart_time;
+ int auto_recharge_time_power_off;
int temp_polling_time;
struct regulator_init_data *batt_init_data;
struct bq2419x_charger_platform_data *chg_pdata;
@@ -1341,6 +1343,13 @@ static struct bq2419x_platform_data *bq2419x_dt_parse(struct i2c_client *client)
pdata->bcharger_pdata->wdt_timeout = wdt_timeout;
ret = of_property_read_u32(batt_reg_node,
+ "ti,auto-recharge-time-power-off",
+ &auto_recharge_time_power_off);
+ if (!ret)
+ pdata->bcharger_pdata->auto_recharge_time_power_off =
+ auto_recharge_time_power_off;
+
+ ret = of_property_read_u32(batt_reg_node,
"ti,auto-recharge-time", &chg_restart_time);
if (!ret)
pdata->bcharger_pdata->chg_restart_time =
@@ -1536,6 +1545,8 @@ static int bq2419x_probe(struct i2c_client *client,
goto skip_bcharger_init;
}
+ bq2419x->auto_recharge_time_power_off =
+ pdata->bcharger_pdata->auto_recharge_time_power_off;
bq2419x->wdt_time_sec = pdata->bcharger_pdata->wdt_timeout;
bq2419x->chg_restart_time = pdata->bcharger_pdata->chg_restart_time;
bq2419x->battery_presense = true;
@@ -1643,6 +1654,10 @@ static void bq2419x_shutdown(struct i2c_client *client)
if (bq2419x->cable_connected && bq2419x->in_current_limit > 500 &&
bq2419x->wdt_refresh_timeout) {
+ if ((bq2419x->chg_status == BATTERY_CHARGING_DONE)
+ && bq2419x->auto_recharge_time_power_off)
+ bq2419x->wdt_refresh_timeout =
+ bq2419x->auto_recharge_time_power_off;
ret = battery_charging_system_reset_after(bq2419x->bc_dev,
bq2419x->wdt_refresh_timeout);
if (ret < 0)