diff options
author | Todd Broch <tbroch@chromium.org> | 2017-04-20 09:08:15 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-05-08 21:39:39 +0000 |
commit | 87acd57169dd53673f940824a9d5d14441ef38e4 (patch) | |
tree | 9880edae7b3025492eb751fb50e619deb95a6c92 | |
parent | 473a8ed673bcd33d78d2a86db0518be445c3b61d (diff) | |
download | chrome-ec-87acd57169dd53673f940824a9d5d14441ef38e4.tar.gz |
pd: Ignore Augmented PDOs when choosing PDO to request.
Augmented PDOs are part of the PD3.0 specification. As present USB PD
sinks can't support these PDO types we need to ignore them.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus,glados,oak,gru,reef
BUG=b:37476637
TEST=manual,
On samus, plug-in blackcat (EVT) charger and see it ignore these
Augmented PDOs when making its PDO request.
Original-Change-Id: I28a0377e1486368f25f37cad640af71244a4c30b
Originally-Reviewed-on: https://chromium-review.googlesource.com/484687
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 49c776b5b78462ae2118fca240f7fb5df7dc444c)
Change-Id: I372c4cde3bd3521fd21d830fcd73f6bc462199f4
Reviewed-on: https://chromium-review.googlesource.com/493845
Tested-by: Todd Broch <tbroch@chromium.org>
Trybot-Ready: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | common/usb_pd_policy.c | 4 | ||||
-rw-r--r-- | include/usb_pd.h | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index d4d35447db..afbaacc088 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -105,6 +105,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++) { + /* its an unsupported Augmented PDO (PD3.0) */ + if ((src_caps[i] & PDO_TYPE_MASK) == PDO_TYPE_AUGMENTED) + continue; + mv = ((src_caps[i] >> 10) & 0x3FF) * 50; /* Skip any voltage not supported by this board */ if (!pd_is_valid_input_voltage(mv)) diff --git a/include/usb_pd.h b/include/usb_pd.h index a6be237102..f039af1a83 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -57,11 +57,14 @@ enum pd_rx_errors { * if present shall be sent in Minimum Voltage order; lowest to highest. * 4. The Variable Supply (non battery) Objects, * if present, shall be sent in Minimum Voltage order; lowest to highest. - */ -#define PDO_TYPE_FIXED (0 << 30) -#define PDO_TYPE_BATTERY (1 << 30) -#define PDO_TYPE_VARIABLE (2 << 30) -#define PDO_TYPE_MASK (3 << 30) + * 5. (PD3.0) The Augmented PDO is defined to allow extension beyond the 4 PDOs + * above by examining bits <29:28> to determine the additional PDO function. + */ +#define PDO_TYPE_FIXED (0 << 30) +#define PDO_TYPE_BATTERY (1 << 30) +#define PDO_TYPE_VARIABLE (2 << 30) +#define PDO_TYPE_AUGMENTED (3 << 30) +#define PDO_TYPE_MASK (3 << 30) #define PDO_FIXED_DUAL_ROLE (1 << 29) /* Dual role device */ #define PDO_FIXED_SUSPEND (1 << 28) /* USB Suspend supported */ |