From ee5451a866ad69461ae08e9e7e9b0bf818621d34 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Wed, 7 Apr 2021 17:42:03 +0800 Subject: usb_common: support parse Augmented PDO Change the function signature to void pd_extract_pdo_power(uint32_t pdo, uint32_t *ma, uint32_t *max_mv, uint32_t *min_mv); Replace the original caller with an extra unused parameter, no functional changes. BUG=none TEST=`pd 0 srccaps` prints the correct PDO info BRANCH=asurada Change-Id: I9b508e1a13737fe3ed61e6086416cff0c8ffb9a9 Signed-off-by: Eric Yilun Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810660 Reviewed-by: Wai-Hong Tam --- common/usb_pd_protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/usb_pd_protocol.c') diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index ca28ed852a..1734be269d 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1529,7 +1529,7 @@ static void pd_update_pdo_flags(int port, int pdo_cnt, uint32_t *pdos) * - it presents at least 27 W of available power */ if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) { - uint32_t max_ma, max_mv, max_pdo, max_mw; + uint32_t max_ma, max_mv, max_pdo, max_mw, unused; /* * Get max power that the partner offers (not necessarily what @@ -1537,7 +1537,7 @@ static void pd_update_pdo_flags(int port, int pdo_cnt, uint32_t *pdos) */ pd_find_pdo_index(pdo_cnt, pdos, PD_REV3_MAX_VOLTAGE, &max_pdo); - pd_extract_pdo_power(max_pdo, &max_ma, &max_mv); + pd_extract_pdo_power(max_pdo, &max_ma, &max_mv, &unused); max_mw = max_ma * max_mv / 1000; if (!(pdos[0] & PDO_FIXED_DUAL_ROLE) || -- cgit v1.2.1