From 79ae73477c1d6a84ce9c64eb82a183a163aa3646 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Thu, 10 Aug 2017 13:12:30 -0700 Subject: charge_manager: Consider port in source PDO. When CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT is defined for a board, as its name implies, the board can source a higher current if there is only one port acting as a source. This commit fixes an issue with selecting the right source capability message to advertise. charge_manager_get_source_pdo() was simply checking if there was more than one sink connected, instead of checking if there were any *other* sinks connected. In the event that a sink was connected to a different port, we would advertise the max source PDO. BUG=b:64037926, b:35577509 BRANCH=gru,eve,reef TEST=Connect sink to port 1. Connect a AMA to port 0 that claims that VBUS isn't necessary. Start sending source caps, verify that the max PDO is not being advertised in the source caps. Change-Id: Ie4145ecaf98d5b9070ad3e8b139e5653685fa801 Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/610479 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Shawn N --- board/plankton/usb_pd_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/plankton') diff --git a/board/plankton/usb_pd_policy.c b/board/plankton/usb_pd_policy.c index 6db20d33cb..42dd5180f8 100644 --- a/board/plankton/usb_pd_policy.c +++ b/board/plankton/usb_pd_policy.c @@ -55,7 +55,7 @@ void board_set_source_cap(enum board_src_cap cap) pd_src_pdo_idx = cap; } -int charge_manager_get_source_pdo(const uint32_t **src_pdo) +int charge_manager_get_source_pdo(const uint32_t **src_pdo, const int port) { *src_pdo = pd_src_pdo; return pd_src_pdo_cnts[pd_src_pdo_idx]; -- cgit v1.2.1