pd: allow request message over max current if mismatch bit set

Allow a request message over our max current if the mismatch bit
is set as per the PD spec.

BUG=chromium:542832
BRANCH=samus,ryu
TEST=load onto samus and connect to a ryu that is requesting 1A
max with mismatch bit set, and verify that we accept the request

Change-Id: I486495422c972a43927bb2ebffc64c2b9f9ac445
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/305375
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
This commit is contained in:
Alec Berg
2015-10-13 14:12:42 -07:00
committed by chrome-bot
parent 89067fc458
commit e0df5cbaf0

View File

@@ -49,7 +49,7 @@ int pd_check_requested_voltage(uint32_t rdo)
pdo_ma = (pdo & 0x3ff);
if (op_ma > pdo_ma)
return EC_ERROR_INVAL; /* too much op current */
if (max_ma > pdo_ma)
if (max_ma > pdo_ma && !(rdo & RDO_CAP_MISMATCH))
return EC_ERROR_INVAL; /* too much max current */
CPRINTF("Requested %d V %d mA (for %d/%d mA)\n",