summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2017-04-20 09:08:15 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-02 20:24:17 -0700
commit49c776b5b78462ae2118fca240f7fb5df7dc444c (patch)
treeb50be0753b89b2d688de370e0edd8a58d59ca3d3
parent520bd3f6ad2098e6969dd353350e2e2281f28989 (diff)
downloadchrome-ec-49c776b5b78462ae2118fca240f7fb5df7dc444c.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. 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. Change-Id: I28a0377e1486368f25f37cad640af71244a4c30b 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>
-rw-r--r--common/usb_pd_policy.c4
-rw-r--r--include/usb_pd.h13
2 files changed, 12 insertions, 5 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index 568169fbbf..62f9ecbfa5 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -106,6 +106,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 invalid voltage */
if (!mv)
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 01b4ed5358..4f7ce8c52b 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 */