diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2021-04-27 10:20:45 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-27 04:28:18 +0000 |
commit | 8d24309955adcab6a27532e1379cb5e3a7208573 (patch) | |
tree | c4d977a85bfd3b084b4dfc9d465ebf0c52676bdc /baseboard | |
parent | 36fa7517aa6bb93be6ba75499289418e3a208978 (diff) | |
download | chrome-ec-8d24309955adcab6a27532e1379cb5e3a7208573.tar.gz |
asurada: fix querying ADC for VBUS
charge_manager_get_vbus would assume the VBUS is 5V when
the PD statue is sourceing, and this is not what we expected.
Directly query the ADC instead.
BUG=b:186176093
TEST=USB disk can be enumerated.
BRANCH=asurada
Change-Id: I38bb706764827fbc109dcde5df87dfa0927e40aa
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2852360
Tested-by: Eric Yilun Lin <yllin@google.com>
Tested-by: Hsu Alvis <alvishsu@google.com>
Auto-Submit: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/asurada/usb_pd_policy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/baseboard/asurada/usb_pd_policy.c b/baseboard/asurada/usb_pd_policy.c index 7422e6771f..f9b8bb6cd1 100644 --- a/baseboard/asurada/usb_pd_policy.c +++ b/baseboard/asurada/usb_pd_policy.c @@ -2,6 +2,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ +#include "adc.h" #include "charge_manager.h" #include "chipset.h" #include "timer.h" @@ -156,7 +157,7 @@ int pd_snk_is_vbus_provided(int port) * (b:181203590#comment20) TODO(yllin): use * PD_VSINK_DISCONNECT_PD for non-5V case. */ - return charge_manager_get_vbus_voltage(port) >= + return adc_read_channel(board_get_vbus_adc(port)) >= PD_V_SINK_DISCONNECT_MAX; } |