ab8500-charger: Kick watchdog
authorLee Jones <lee.jones@linaro.org>
Thu, 17 Jan 2013 13:40:32 +0000 (13:40 +0000)
committerLee Jones <lee.jones@linaro.org>
Wed, 23 Jan 2013 11:33:05 +0000 (11:33 +0000)
Kicks the watchdog so charging will not stop.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/power/abx500_chargalg.c

index 78b623572b526426f1004a9846abaa9707d30a8d..830b2dd7ac6d135dceebcba6aa080b34a0cc4851 100644 (file)
@@ -603,6 +603,8 @@ static void abx500_chargalg_hold_charging(struct abx500_chargalg *di)
 static void abx500_chargalg_start_charging(struct abx500_chargalg *di,
        int vset, int iset)
 {
+       bool start_chargalg_wd = true;
+
        switch (di->chg_info.charger_type) {
        case AC_CHG:
                dev_dbg(di->dev,
@@ -620,8 +622,12 @@ static void abx500_chargalg_start_charging(struct abx500_chargalg *di,
 
        default:
                dev_err(di->dev, "Unknown charger to charge from\n");
+               start_chargalg_wd = false;
                break;
        }
+
+       if (start_chargalg_wd && !delayed_work_pending(&di->chargalg_wd_work))
+               queue_delayed_work(di->chargalg_wq, &di->chargalg_wd_work, 0);
 }
 
 /**