diff options
author | Aseda Aboagye <aaboagye@google.com> | 2020-07-14 15:15:08 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-21 01:34:51 +0000 |
commit | b72dd67b84b8b122a880b59b0a10455baf93fb62 (patch) | |
tree | 6e8a4526f480b4379162fe6779de68e883bbb80b /board/drawcia/board.c | |
parent | e2244743f3b03962d1adb3c49c20a99a0618e4c9 (diff) | |
download | chrome-ec-b72dd67b84b8b122a880b59b0a10455baf93fb62.tar.gz |
drawcia: Use VBUS ADC for extpower
There's an issue with the CHG_DET bit which was causing the AC change
notifications to not occur. This commit replaces the usage of the
CHG_DET bit with reading the VBUS ADCs to determine VBUS presence.
BUG=b:161269327
BRANCH=None
TEST=`make -j buildall`
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Ica8a6419b663f57a7eeafd122e6cfce73a58d77c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2297984
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/drawcia/board.c')
-rw-r--r-- | board/drawcia/board.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c index 7493f3737f..d8ac3b8063 100644 --- a/board/drawcia/board.c +++ b/board/drawcia/board.c @@ -338,13 +338,7 @@ uint16_t tcpc_get_alert_status(void) int extpower_is_present(void) { - int chg0 = 0; - int chg1 = 0; - - sm5803_get_chg_det(0, &chg0); - sm5803_get_chg_det(1, &chg1); - - return chg0 || chg1; + return sm5803_is_vbus_present(0) || sm5803_is_vbus_present(1); } void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma, |