diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-01-17 11:31:43 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-17 23:19:47 +0000 |
commit | 7fc407a93437929ec925c3041051a41bd2e83df6 (patch) | |
tree | 744b55b8a371b9bfba5df958b24cbf4865a35f55 /common | |
parent | 13827088583ebe46c89fd0bb4d7889ccb5f9b948 (diff) | |
download | chrome-ec-7fc407a93437929ec925c3041051a41bd2e83df6.tar.gz |
pd: samus: do not request voltage within boost bypass deadband
Do not request a voltage that is within the deadband where we
aren't sure if the boost or the boost bypass is on.
BUG=chrome-os-partner:34938
BRANCH=samus
TEST=test on samus with zinger. change the deadband to [10V, 20V]
and see that we only negotiate to 5V. change the deadband to
[13V, 20V] and see that we negotiate to 12V. change the deadband
to [10V, 13V] and see that we negotiate to 20V.
Change-Id: Id761aef35eeadfa2ab7d2ca31a48d4324625ab32
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/241528
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_pd_policy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index b95ef726d0..e67f08caa1 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -61,6 +61,10 @@ static int pd_find_pdo_index(int cnt, uint32_t *src_caps, int max_mv) /* Get max power that is under our max voltage input */ for (i = 0; i < cnt; i++) { mv = ((src_caps[i] >> 10) & 0x3FF) * 50; + /* Skip any voltage not supported by this board */ + if (!pd_is_valid_input_voltage(mv)) + continue; + if ((src_caps[i] & PDO_TYPE_MASK) == PDO_TYPE_BATTERY) { uw = 250000 * (src_caps[i] & 0x3FF); } else { |