summaryrefslogtreecommitdiff
path: root/common/charger.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/charger.c')
-rw-r--r--common/charger.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/charger.c b/common/charger.c
index 21320fcd4d..aac623d74a 100644
--- a/common/charger.c
+++ b/common/charger.c
@@ -444,6 +444,10 @@ enum ec_error_list charger_get_vbus_voltage(int port, int *voltage)
int chgnum = 0;
int rv = 0;
+ /* Note: Assumes USBPD port == chgnum on multi-charger systems */
+ if (!IS_ENABLED(CONFIG_CHARGER_SINGLE_CHIP))
+ chgnum = port;
+
if ((chgnum < 0) || (chgnum >= chg_cnt)) {
CPRINTS("%s(%d) Invalid charger!", __func__, chgnum);
return 0;