diff options
author | Patryk Duda <pdk@semihalf.com> | 2020-12-15 16:55:55 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-15 23:50:38 +0000 |
commit | 0bfbb5c932d1d847a73ef22a5eca6b66bafa0c10 (patch) | |
tree | 4f40314f3eb03ea40d15d0c4491e9b6c28b1515b | |
parent | 5316af00b3389dd9f1da04ce2c9bfe0a504e2d91 (diff) | |
download | chrome-ec-0bfbb5c932d1d847a73ef22a5eca6b66bafa0c10.tar.gz |
usb_pd_dual_role: Respect max voltage limit when processing capabilities
To process source capabilities received from charger we just find the
most appropriate PDO and inform charge manager about our choice
(pd_process_source_cap() function). This function doesn't respect any
voltage limits, so even when such a limit exists charge manager will be
informed about higher voltage. Of course PD stack will request correct
voltage from charger and charge manager will be notified about that
fact, but providing wrong information about voltage can cause
unnecessary new power requests.
This issue was found during debugging EC hibernate issue on casta.
BUG=b:161775827
BRANCH=none
TEST=Flash EC ToT on casta. Set voltage limit to 5V. Observe if
charge manager reports voltage changes from 5V to 15V (in my case)
when received capabilities from ServoV4.
NOTE: ServoV4 will send capabilities to DUT as a result of voltage
transition (requested by ServoV4).
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I5fe30f7a1b86fb1d934a29429147d9d7c9a84337
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592496
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | common/usb_pd_dual_role.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/usb_pd_dual_role.c b/common/usb_pd_dual_role.c index fc70a6099a..683c2f1837 100644 --- a/common/usb_pd_dual_role.c +++ b/common/usb_pd_dual_role.c @@ -350,7 +350,7 @@ void pd_process_source_cap(int port, int cnt, uint32_t *src_caps) /* Get max power info that we could request */ pd_find_pdo_index(pd_get_src_cap_cnt(port), pd_get_src_caps(port), - PD_MAX_VOLTAGE_MV, &pdo); + pd_get_max_voltage(), &pdo); pd_extract_pdo_power(pdo, &ma, &mv); /* Set max. limit, but apply 500mA ceiling */ |