summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2019-12-09 11:14:04 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-09 09:11:53 +0000
commit7ab6523fe5a8badb379e93fe9bb07c85df40eac6 (patch)
tree2e43c5ea46bd624d9599d174b4ab128e007d78c2
parent54da7ca73b726fe29a61ee5f7029c4b66619b239 (diff)
downloadchrome-ec-7ab6523fe5a8badb379e93fe9bb07c85df40eac6.tar.gz
charger/rt946x: fix updating CHARGE_SUPPLIER_NONE
If the supplier is CHARGE_SUPPLIER_NONE (-1), then we shouldn't update charge_manager information. TEST=plug PD charger, and unplug, and see manual_voltage and manual_current are not clobbered. BUG=b:145721867, b:141005922 BRANCH=kukui Change-Id: I05c17a8f600cc780288d732ac9ed28fd86090867 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957610 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--driver/charger/rt946x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c
index f389188bad..bbc1357c56 100644
--- a/driver/charger/rt946x.c
+++ b/driver/charger/rt946x.c
@@ -1548,7 +1548,8 @@ bc12_none:
}
/* VBUS detach event */
- if (reg & RT946X_MASK_DPDMIRQ_DETACH) {
+ if (reg & RT946X_MASK_DPDMIRQ_DETACH &&
+ bc12_type != CHARGE_SUPPLIER_NONE) {
CPRINTS("VBUS detached");
bc12_cnt = 0;
#ifdef CONFIG_WIRELESS_CHARGER_P9221_R7