summaryrefslogtreecommitdiff
path: root/driver/charger/sm5803.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2021-05-17 20:26:39 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-19 20:26:23 +0000
commit848a2cb8c29a8b5ca38c6d83578f78f01e496cd1 (patch)
tree98a65c57ee6f5a9d400c658b70ca498b0300c7e1 /driver/charger/sm5803.c
parent48c2e894a960a186a1b19b21ad270d7a2f62ed00 (diff)
downloadchrome-ec-848a2cb8c29a8b5ca38c6d83578f78f01e496cd1.tar.gz
dedede: Rework `extpower_is_present()`
The dedede boards erroneously assumed that if VBUS was present, then "extpower" was present. "extpower" is generally connected to the ACOK signal for the battery charger IC. It indicates that the voltage present at the switching node is valid for bucking or boosting. For our Type-C systems, this needs to be at least 4V. However, just because VBUS is present doesn't mean that the voltage is present at the switching node. The FETs on the selected charge port needs to be enabled first. This commit simply changes the logic to check the battery charger ICs' ACOK status to reflect whether extpower is present. BUG=b:187965740 BRANCH=dedede TEST=Build and flash drawcia and madoo, verify that "AC on" prints are emitted when the charge port is selected and not just when VBUS appears on the port. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: If5a4a10d502f2f08ccf1d3228e42f48fa6d45909 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2901254 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/charger/sm5803.c')
-rw-r--r--driver/charger/sm5803.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/charger/sm5803.c b/driver/charger/sm5803.c
index d4a20826a7..dd19cdb567 100644
--- a/driver/charger/sm5803.c
+++ b/driver/charger/sm5803.c
@@ -1080,7 +1080,7 @@ void sm5803_handle_interrupt(int chgnum)
/* Update extpower if VCHGPWR changes. */
if (int_reg & SM5803_INT2_VCHGPWR)
- board_vbus_present_change();
+ board_check_extpower();
/* TODO(b/159376384): Take action on fatal BFET power alert. */
rv = main_read8(chgnum, SM5803_REG_INT3_REQ, &int_reg);