diff options
author | Loic Pallardy <loic.pallardy@stericsson.com> | 2012-05-10 09:33:56 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-01-23 09:39:15 -0500 |
commit | e07a56453b14b929cf01bf032cc3e3220094609c (patch) | |
tree | 78fff3a900cdb885a58da090575e66656a6861c8 /drivers/power/abx500_chargalg.c | |
parent | e3455002d04276c256a531f7175dce0f7d1cb78a (diff) |
pm2301: Update watchdog for pm2xxx support
AB and PMxxx doesn't have same watchdog refresh period. Add watchdog
to refresh period parameters in x500 charger structure, this should
kick watchdog every 30sec. The AC charging should also kick both
pm2xxx and the AB charger watchdog.
Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/power/abx500_chargalg.c')
-rw-r--r-- | drivers/power/abx500_chargalg.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index f59bc025ca58..7defb3e91d59 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c | |||
@@ -445,8 +445,18 @@ static int abx500_chargalg_kick_watchdog(struct abx500_chargalg *di) | |||
445 | { | 445 | { |
446 | /* Check if charger exists and kick watchdog if charging */ | 446 | /* Check if charger exists and kick watchdog if charging */ |
447 | if (di->ac_chg && di->ac_chg->ops.kick_wd && | 447 | if (di->ac_chg && di->ac_chg->ops.kick_wd && |
448 | di->chg_info.online_chg & AC_CHG) | 448 | di->chg_info.online_chg & AC_CHG) { |
449 | /* | ||
450 | * If AB charger watchdog expired, pm2xxx charging | ||
451 | * gets disabled. To be safe, kick both AB charger watchdog | ||
452 | * and pm2xxx watchdog. | ||
453 | */ | ||
454 | if (di->ac_chg->external && | ||
455 | di->usb_chg && di->usb_chg->ops.kick_wd) | ||
456 | di->usb_chg->ops.kick_wd(di->usb_chg); | ||
457 | |||
449 | return di->ac_chg->ops.kick_wd(di->ac_chg); | 458 | return di->ac_chg->ops.kick_wd(di->ac_chg); |
459 | } | ||
450 | else if (di->usb_chg && di->usb_chg->ops.kick_wd && | 460 | else if (di->usb_chg && di->usb_chg->ops.kick_wd && |
451 | di->chg_info.online_chg & USB_CHG) | 461 | di->chg_info.online_chg & USB_CHG) |
452 | return di->usb_chg->ops.kick_wd(di->usb_chg); | 462 | return di->usb_chg->ops.kick_wd(di->usb_chg); |