diff options
author | Diana Z <dzigterman@chromium.org> | 2020-08-25 11:02:36 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-29 22:41:12 +0000 |
commit | 9ead22ae18de72b17b5a3d86462b3da16fde1376 (patch) | |
tree | a06b7d3d48bd8c879ac788f77ffea9507da6090d | |
parent | 4dd9a7f4b97d83a79528615feb8e139a1e3ed5e6 (diff) | |
download | chrome-ec-9ead22ae18de72b17b5a3d86462b3da16fde1376.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>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383894
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | common/charger.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/charger.c b/common/charger.c index 68f8f71ced..eefdcb59cd 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; |