diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2021-04-07 17:42:03 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-08 03:30:37 +0000 |
commit | ee5451a866ad69461ae08e9e7e9b0bf818621d34 (patch) | |
tree | 4b03e75e708f2f211511482d3601116168471242 /board/servo_v4 | |
parent | 1370a872dd381369fb1d75113a43a147fd31105f (diff) | |
download | chrome-ec-ee5451a866ad69461ae08e9e7e9b0bf818621d34.tar.gz |
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 <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810660
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/servo_v4')
-rw-r--r-- | board/servo_v4/usb_pd_policy.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c index ace296c46f..e85c6b0328 100644 --- a/board/servo_v4/usb_pd_policy.c +++ b/board/servo_v4/usb_pd_policy.c @@ -273,7 +273,7 @@ static void board_manage_dut_port(void) static void update_ports(void) { int pdo_index, src_index, snk_index, i; - uint32_t pdo, max_ma, max_mv; + uint32_t pdo, max_ma, max_mv, unused; /* * CHG Vbus has changed states, update PDO that reflects CHG port @@ -307,7 +307,8 @@ static void update_ports(void) continue; snk_index = pdo_index; - pd_extract_pdo_power(pdo, &max_ma, &max_mv); + pd_extract_pdo_power(pdo, &max_ma, &max_mv, + &unused); pd_src_chg_pdo[src_index++] = PDO_FIXED_VOLT(max_mv) | PDO_FIXED_CURR(max_ma) | @@ -624,9 +625,9 @@ int charge_manager_get_source_pdo(const uint32_t **src_pdo, const int port) __override void pd_transition_voltage(int idx) { timestamp_t deadline; - uint32_t ma, mv; + uint32_t ma, mv, unused; - pd_extract_pdo_power(pd_src_chg_pdo[idx - 1], &ma, &mv); + pd_extract_pdo_power(pd_src_chg_pdo[idx - 1], &ma, &mv, &unused); /* Is this a transition to a new voltage? */ if (charge_port_is_active() && vbus[CHG].mv != mv) { /* @@ -1211,13 +1212,13 @@ static int cmd_ada_srccaps(int argc, char *argv[]) const uint32_t * const ada_srccaps = pd_get_src_caps(CHG); for (i = 0; i < pd_get_src_cap_cnt(CHG); ++i) { - uint32_t max_ma, max_mv; + uint32_t max_ma, max_mv, unused; /* It's an supported Augmented PDO (PD3.0) */ if ((ada_srccaps[i] & PDO_TYPE_MASK) == PDO_TYPE_AUGMENTED) continue; - pd_extract_pdo_power(ada_srccaps[i], &max_ma, &max_mv); + pd_extract_pdo_power(ada_srccaps[i], &max_ma, &max_mv, &unused); ccprintf("%d: %dmV/%dmA\n", i, max_mv, max_ma); } |