summaryrefslogtreecommitdiff
path: root/common/charger.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-08-25 11:02:36 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-27 17:58:07 +0000
commitffbc66137e4033eccd13a339043efbc24a0e8aab (patch)
tree0f785baaa115e9bf922cb1ee2acca3d8d525535b /common/charger.c
parent8bae64484f8b655415acfb7ff84051b40bade659 (diff)
downloadchrome-ec-ffbc66137e4033eccd13a339043efbc24a0e8aab.tar.gz
OCPC: Assume port == chgnum when checking OTG
Since OCPC has one charger chip per port, it can be assumed in the charger_is_sourcing_otg_power() function that the port will be the same as the charger number with this config enabled. BRANCH=None BUG=b:147440290 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iff5130e9ac7c268d38fe75eb3eb1c9ea5864abd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/charger.c')
-rw-r--r--common/charger.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/charger.c b/common/charger.c
index 666d170279..0bafba5a10 100644
--- a/common/charger.c
+++ b/common/charger.c
@@ -355,6 +355,9 @@ int charger_is_sourcing_otg_power(int port)
int chgnum = 0;
int rv = 0;
+ if (IS_ENABLED(CONFIG_OCPC))
+ chgnum = port;
+
if ((chgnum < 0) || (chgnum >= board_get_charger_chip_count())) {
CPRINTS("%s(%d) Invalid charger!", __func__, chgnum);
return 0;