summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-02-11 13:55:11 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-16 18:19:54 +0000
commitca711388455097479c1e80a243a5ca91b0272805 (patch)
tree6ae3e93ab11f8c3a1d80edbf08ad2fdfc175b225
parent66f40e3b1634f2c3bfa39d643a67010036a54480 (diff)
downloadchrome-ec-ca711388455097479c1e80a243a5ca91b0272805.tar.gz
USB PD: Report operating power in sink capabilities
Currently, the vSafe5V sink capability response reports desiring a flat 500mA for every board. This is out of sync with the battery and variable capabilities, which report requiring our defined operating power or maximum current. Change the 500mA to the operating power divided over 5 volts, or the maximum current (whichever is smaller). BRANCH=None BUG=b:179423663 TEST=on voxel, confirm sink capabilities report wanting 3.0A for vSafe5V and confirm drawcia will offer 3.0A when voxel charges Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I22866d28a0571634a7a112f4f306ed89b70c9b02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691417 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697850 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Tested-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usb_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index 81e9d2f24f..d8d9208ab8 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -619,7 +619,9 @@ const uint32_t pd_src_pdo_max[] = {
const int pd_src_pdo_max_cnt = ARRAY_SIZE(pd_src_pdo_max);
const uint32_t pd_snk_pdo[] = {
- PDO_FIXED(5000, 500, PDO_FIXED_FLAGS),
+ PDO_FIXED(5000,
+ GENERIC_MIN((PD_OPERATING_POWER_MW / 5), PD_MAX_CURRENT_MA),
+ PDO_FIXED_FLAGS),
PDO_BATT(4750, PD_MAX_VOLTAGE_MV, PD_OPERATING_POWER_MW),
PDO_VAR(4750, PD_MAX_VOLTAGE_MV, PD_MAX_CURRENT_MA),
};