summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-07-15 12:57:40 +0530
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 08:50:28 +0100
commitb25d9f06a8c559bffef7d7c5a8077a7720b4b444 (patch)
tree9c9e4d7940f46b9f9aa8ddb0865dad3cf58436be /drivers/power
parent2cee2ceae81d21eb8269be627a3565aace514499 (diff)
power: ab5500-charger: update the watchdog rekick seq
In AB5500 there exist no charger watchdog, instead all the charging registers that are written during enabling charging are to be re-written which acts as a watchdog re-kick. Even though its usb charging DCIOCURRENT register has to be written in order to kick charging, else charging is not started. ST-Ericsson Linux next: Not Tested ST-Ericsson ID: WP257120 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Iad283349e21027908df8aec560c9f44f2861f0ee Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/27220 Reviewed-by: Johan PALSSON <johan.palsson@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/ab5500_charger.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/power/ab5500_charger.c b/drivers/power/ab5500_charger.c
index 69b808f06d7..b30f00a57f9 100644
--- a/drivers/power/ab5500_charger.c
+++ b/drivers/power/ab5500_charger.c
@@ -825,6 +825,21 @@ static int ab5500_charger_usb_en(struct ux500_charger *charger,
__func__, __LINE__);
return ret;
}
+
+ /*
+ * Register DCIOCURRENT is one among the charging watchdog
+ * rekick sequence, hence irrespective of usb charging this
+ * register will have to be written.
+ */
+ ret = abx500_set_register_interruptible(di->dev,
+ AB5500_BANK_CHG, AB5500_DCIOCURRENT,
+ RESET);
+ if (ret) {
+ dev_err(di->dev, "%s write failed %d\n",
+ __func__, __LINE__);
+ return ret;
+ }
+
di->usb.charger_online = 1;
} else {
/* ChVoltLevel: max voltage upto which battery can be charged */
@@ -946,6 +961,19 @@ static int ab5500_charger_watchdog_kick(struct ux500_charger *charger)
dev_err(di->dev, "%s write failed %d\n", __func__, __LINE__);
return ret;
}
+ /*
+ * Register DCIOCURRENT is one among the charging watchdog
+ * rekick sequence, hence irrespective of usb charging this
+ * register will have to be written.
+ */
+ ret = abx500_set_register_interruptible(di->dev,
+ AB5500_BANK_CHG, AB5500_DCIOCURRENT,
+ RESET);
+ if (ret) {
+ dev_err(di->dev, "%s write failed %d\n", __func__, __LINE__);
+ return ret;
+ }
+
return ret;
}