summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-11-09 17:30:13 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-28 15:44:18 -0800
commit443207913b0490e004a87151ebf51f1b96140edd (patch)
tree28e113c586f0cb8e57d44629b5d217b7b2a9a5fc /common
parent84b20f922533b5b1d282fcfc323400b0eec0db27 (diff)
downloadchrome-ec-443207913b0490e004a87151ebf51f1b96140edd.tar.gz
charge_manager: Give dedicated chargers highest priority
This patch lowers the priorities of other chargers so that dedicated chargers are given the highest priority. Dedicated chargers are adapters shipped with the device and do nothing but being the power source. Thus, when they're connected, it should be always used even if other suppliers offer more power. BUG=b:38321259 BRANCH=none TEST=make runtests Change-Id: Ida862eb31c7f9ede36cade99f53645196b6a3f70 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/762339 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/charge_manager.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c
index e2256fdcfc..2a97e66235 100644
--- a/common/charge_manager.c
+++ b/common/charge_manager.c
@@ -30,19 +30,19 @@
/* Charge supplier priority: lower number indicates higher priority. */
test_mockable const int supplier_priority[] = {
- [CHARGE_SUPPLIER_PD] = 0,
#if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0
[CHARGE_SUPPLIER_DEDICATED] = 0,
#endif
- [CHARGE_SUPPLIER_TYPEC] = 1,
- [CHARGE_SUPPLIER_TYPEC_DTS] = 1,
+ [CHARGE_SUPPLIER_PD] = 1,
+ [CHARGE_SUPPLIER_TYPEC] = 2,
+ [CHARGE_SUPPLIER_TYPEC_DTS] = 2,
#ifdef CHARGE_MANAGER_BC12
- [CHARGE_SUPPLIER_PROPRIETARY] = 1,
- [CHARGE_SUPPLIER_BC12_DCP] = 2,
- [CHARGE_SUPPLIER_BC12_CDP] = 3,
- [CHARGE_SUPPLIER_BC12_SDP] = 4,
- [CHARGE_SUPPLIER_OTHER] = 5,
- [CHARGE_SUPPLIER_VBUS] = 6
+ [CHARGE_SUPPLIER_PROPRIETARY] = 2,
+ [CHARGE_SUPPLIER_BC12_DCP] = 3,
+ [CHARGE_SUPPLIER_BC12_CDP] = 4,
+ [CHARGE_SUPPLIER_BC12_SDP] = 5,
+ [CHARGE_SUPPLIER_OTHER] = 6,
+ [CHARGE_SUPPLIER_VBUS] = 7
#endif
};
BUILD_ASSERT(ARRAY_SIZE(supplier_priority) == CHARGE_SUPPLIER_COUNT);