mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user