summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/charge_manager.c2
-rw-r--r--include/config.h11
2 files changed, 12 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)
diff --git a/include/config.h b/include/config.h
index 45e144484d..4d3f401070 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3096,6 +3096,17 @@
/*****************************************************************************/
/*
+ * Define CONFIG_USB_PD_VBUS_MEASURE_CHARGER if the charger on the board
+ * supports VBUS measurement.
+ */
+#if defined(CONFIG_CHARGER_BD9995X) || \
+ defined(CONFIG_CHARGER_RT9466) || \
+ defined(CONFIG_CHARGER_RT9467)
+#define CONFIG_USB_PD_VBUS_MEASURE_CHARGER
+#endif
+
+/*****************************************************************************/
+/*
* Handle task-dependent configs.
*
* This prevent sub-modules from being compiled when the task and parent module