summaryrefslogtreecommitdiff
path: root/driver/charger/isl9241.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-08-02 18:01:23 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-05 23:18:08 +0000
commit8ea82b8abba7e287a6c9f5ee62d4a466e1d2b7dc (patch)
tree7ef90ceb709c3dec0eb312a7339f909d872fe236 /driver/charger/isl9241.c
parent9a1048e52e7f8595b5ca092a4c2a571514338a3e (diff)
downloadchrome-ec-8ea82b8abba7e287a6c9f5ee62d4a466e1d2b7dc.tar.gz
isl9241: Set AC prochot
Allow AC prochot threshold to be increased to match PD max current. BUG=b:162376053 b:162565066 BRANCH=none TEST=prochot not asserted while battery charges Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I11761e8d2d15b52f7552e8d951c6633583ab5ba8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2334353 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>
Diffstat (limited to 'driver/charger/isl9241.c')
-rw-r--r--driver/charger/isl9241.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/driver/charger/isl9241.c b/driver/charger/isl9241.c
index 2951a1bfd2..d6dbf395d8 100644
--- a/driver/charger/isl9241.c
+++ b/driver/charger/isl9241.c
@@ -320,6 +320,18 @@ static enum ec_error_list isl9241_discharge_on_ac(int chgnum, int enable)
return rv;
}
+int isl9241_set_ac_prochot(int chgnum, int ma)
+{
+ int rv;
+ uint16_t reg = AC_CURRENT_TO_REG(ma);
+
+ rv = isl9241_write(chgnum, ISL9241_REG_AC_PROCHOT, reg);
+ if (rv)
+ CPRINTF("set_ac_prochot failed (%d)", rv);
+
+ return rv;
+}
+
/*****************************************************************************/
/* ISL-9241 initialization */
static void isl9241_init(int chgnum)