summaryrefslogtreecommitdiff
path: root/common/charge_manager.c
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2017-11-26 00:11:49 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-27 22:50:47 -0800
commit675bdc2e2c58cd36161dcec98a5240eb22b43fda (patch)
tree11e3df7bdfd92092ed371e6f7258815337d6d270 /common/charge_manager.c
parenta2e2be193a46826fa6af7fbaab0e567e248e40b4 (diff)
downloadchrome-ec-675bdc2e2c58cd36161dcec98a5240eb22b43fda.tar.gz
Separate VBUS detection and measurement mechanisms
For now we guard charger-based VBUS voltage measurement behind CONFIG_USB_PD_VBUS_DETECT_CHARGER. But we should be able to measure VBUS voltage by charger while detecting VBUS presence by other methods. BUG=b:67991345 BRANCH=none TEST=plug in guppy on Scarlet rev2, 'ectool usbpdpower' on console, and see VBUS is measured as 4975mV Change-Id: I94cada81159ea4b097001997e2444873ec2d8763 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/789910 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/charge_manager.c')
-rw-r--r--common/charge_manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c
index 4a6808b50f..dbf97f000b 100644
--- a/common/charge_manager.c
+++ b/common/charge_manager.c
@@ -370,7 +370,7 @@ static void charge_manager_fill_power_info(int port,
if (r->role == USB_PD_PORT_POWER_SINK_NOT_CHARGING)
r->meas.voltage_now = 5000;
else {
-#ifdef CONFIG_USB_PD_VBUS_DETECT_CHARGER
+#ifdef CONFIG_USB_PD_VBUS_MEASURE_CHARGER
r->meas.voltage_now = charger_get_vbus_voltage(port);
#else
if (ADC_VBUS >= 0)