diff options
author | Ting Shen <phoenixshen@google.com> | 2020-12-25 16:01:21 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-12 07:52:48 +0000 |
commit | a08fad13eda5d04372c66f66a299f4ddb70b26b7 (patch) | |
tree | a0303816b39231a4d95710fcca7864e06f53d944 /common/usb_pd_dual_role.c | |
parent | bb3d7629f3d9fdf8e766301ac607b0186d4e95ef (diff) | |
download | chrome-ec-a08fad13eda5d04372c66f66a299f4ddb70b26b7.tar.gz |
TCPMv1: Replace charging allow list
This CL backports CL:2535217 to TCPMv1, and completely removes charging
allow list.
BRANCH=kukui
BUG=b:175364716
TEST=on Burnet, verify DUT can charge from power bank.
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I89476c89fd4ab6d46acf880f7573b5deb8b2c0f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2603614
Reviewed-by: Diana Z <dzigterman@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'common/usb_pd_dual_role.c')
-rw-r--r-- | common/usb_pd_dual_role.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/common/usb_pd_dual_role.c b/common/usb_pd_dual_role.c index 683c2f1837..d571200c2c 100644 --- a/common/usb_pd_dual_role.c +++ b/common/usb_pd_dual_role.c @@ -21,31 +21,6 @@ */ static unsigned int max_request_mv = PD_MAX_VOLTAGE_MV; -/* - * Partner allow_list pair data to override ability for us to sink from them - * even if they do not present Unconstrained Power in their SRC_Caps. The - * partner pairs in this list should be able to perform as a dual role partner - * and should not present Unconstrained Power. It is best for the partner to - * fix the device so it is not required to be in this list but some devices - * are already out in the wild and will require this for the user's sake. - */ -struct allow_list_pair { - uint16_t vid; - uint16_t pid; -}; - -static struct allow_list_pair allow_list[] = { - {USB_VID_APPLE, USB_PID1_APPLE}, - {USB_VID_APPLE, USB_PID2_APPLE}, - {USB_VID_HP, USB_PID_HP_USB_C_DOCK_G5}, - {USB_VID_HP, USB_PID_HP_USB_C_A_UNIV_DOCK_G2}, - {USB_VID_HP, USB_PID_HP_E24D_DOCK_MONITOR}, - {USB_VID_HP, USB_PID_HP_ELITE_E233_MONITOR}, - {USB_VID_HP, USB_PID_HP_E244D_DOCK_MONITOR}, - {USB_VID_HP, USB_PID_HP_E274D_DOCK_MONITOR}, -}; -static int allow_list_count = ARRAY_SIZE(allow_list); - STATIC_IF_NOT(CONFIG_USB_PD_PREFER_MV) struct pd_pref_config_t __maybe_unused pd_pref_config; @@ -360,26 +335,6 @@ void pd_process_source_cap(int port, int cnt, uint32_t *src_caps) } #endif /* defined(PD_MAX_VOLTAGE_MV) && defined(PD_OPERATING_POWER_MW) */ -int pd_charge_from_device(uint16_t vid, uint16_t pid) -{ - int i; - - /* - * Allow list check for partners that do not set unconstrained bit - * but we still need to charge from it when we are a sink. - */ - for (i = 0; i < allow_list_count; ++i) { - if (vid == allow_list[i].vid && - pid == allow_list[i].pid) - return 1; - } - - if (vid != 0) - CPRINTS("allow_list[] pair not found: vid=0x%X pid=0x%X", - vid, pid); - return 0; -} - bool pd_is_battery_capable(void) { bool capable; |