diff options
author | Yilun Lin <yllin@chromium.org> | 2019-11-19 15:52:16 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-03 11:19:42 +0000 |
commit | 574f168274d659724afb666adad738b1215acf3b (patch) | |
tree | cfef3e46150c37ad763e0674e33e5a7e11c6b8fd /driver/charger/rt946x.h | |
parent | 1dde09f155447f8cdfc39149601fb61817f1822c (diff) | |
download | chrome-ec-574f168274d659724afb666adad738b1215acf3b.tar.gz |
charger/rt946x: fix charger Vsys short
Vsys may short if Ichg and Isys's gap is too huge, and it
will cause the system shutdown.
When the system is charging at 500mA, and if Isys > 3600mA, the
power path will be turned off and cause the system shutdown:
- When Ichg < 400mA, then power path is roughly 1/8 of the original.
- When Isys > 3600mA, this cause the voltage between Vbat and Vsys too
huge (Vbat - Vsys > Vsys short portection) and turns off the power
path.
To workaround this, we have to
1. disable Vsys short protection when Ichg is set below 900mA
2. forbids Ichg <= 400mA (this is done natually on mt6370, since mt6370's
minimum current is 512)
BRANCH=kukui
BUG=b:144532905
TEST=Change ichg setting to test vsys short and
ensure the system won't shutdown.
Change-Id: I6cbdd974f6f0cc94ebd82d419304a0d4e67fcaff
Signed-off-by: Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924169
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'driver/charger/rt946x.h')
-rw-r--r-- | driver/charger/rt946x.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/driver/charger/rt946x.h b/driver/charger/rt946x.h index 9797e95255..6b0228bb3b 100644 --- a/driver/charger/rt946x.h +++ b/driver/charger/rt946x.h @@ -124,6 +124,7 @@ #define MT6370_REG_QCSTATUS2 0x29 #define RT946X_REG_CHGCTRL17 0X2B #define RT946X_REG_CHGCTRL18 0X2C +#define RT946X_REG_CHGHIDDENCTRL7 0x36 #define MT6370_REG_CHGHIDDENCTRL15 0x3E #define RT946X_REG_CHGSTAT 0X4A #define RT946X_REG_CHGNTC 0X4B @@ -444,6 +445,13 @@ MT6370_MASK_APP_DPDM_IN | \ MT6370_MASK_APP_REF) +/* ========= CHGHIDDENCTRL7 0x36 (mt6370) ======== */ +#define RT946X_ENABLE_VSYS_PROTECT 0x40 + +#define RT946X_SHIFT_HIDDENCTRL7_VSYS_PROTECT 5 +#define RT946X_MASK_HIDDENCTRL7_VSYS_PROTECT \ + (0x3 << RT946X_SHIFT_HIDDENCTRL7_VSYS_PROTECT) + /* ========== CHGCTRL18 0x1A ============ */ #define RT946X_SHIFT_IRCMP_RES 3 #define RT946X_SHIFT_IRCMP_VCLAMP 0 |