From e0df5cbaf04d086ad906ef8fc19e31ba2a977590 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Tue, 13 Oct 2015 14:12:42 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/305375 Reviewed-by: Vincent Palatin Reviewed-by: Todd Broch --- common/usb_pd_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index e20605f9ff..5cca1075ea 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -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",