summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-01-06 12:02:14 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-14 23:22:51 +0000
commitd3cef73e459bfd7757872e06e760cb4195c0663e (patch)
treecdb83d9c7f0ad90c5ee26312788f8a29bb642d07 /include
parentd9d96d1b01cb66fbfdc50fe705eaa2cc2579b442 (diff)
downloadchrome-ec-d3cef73e459bfd7757872e06e760cb4195c0663e.tar.gz
usb_pd: Request Vconn swap to communicating with the cable
Before sending SOP' requests to cable plug, the port checks if the port is the Vconn source. If the port isn't the Vconn source, it can't talk to the cable. From USB PD spec 1.3 sections 2.6.1 and 2.6.2, during an explicit contract, after the data and power role swaps, if any, source/sink can initiate or receive a request for exchanging the Vconn source. Hence, adding support for the port to request Vconn swap, if it hasn't already been swapped. BUG=b:147209888 BRANCH=None TEST=Checked on volteer, able to communicate with the cable plug Change-Id: I36d896eda6319970b1a0a9bd7cc4efcbc381c8b1 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1988234 Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index ced7ae26cd..538086db29 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -834,6 +834,9 @@ enum pd_states {
*/
#define PD_FLAGS_SNK_WAITING_BATT BIT(20)
+/* Check vconn state in READY */
+#define PD_FLAGS_CHECK_VCONN_STATE BIT(21)
+
/* Flags to clear on a disconnect */
#define PD_FLAGS_RESET_ON_DISCONNECT_MASK (PD_FLAGS_PARTNER_DR_POWER | \
PD_FLAGS_PARTNER_DR_DATA | \
@@ -850,7 +853,8 @@ enum pd_states {
PD_FLAGS_PARTNER_USB_COMM | \
PD_FLAGS_UPDATE_SRC_CAPS | \
PD_FLAGS_TS_DTS_PARTNER | \
- PD_FLAGS_SNK_WAITING_BATT)
+ PD_FLAGS_SNK_WAITING_BATT | \
+ PD_FLAGS_CHECK_VCONN_STATE)
/* Per-port battery backed RAM flags */
#define PD_BBRMFLG_EXPLICIT_CONTRACT BIT(0)
@@ -1412,6 +1416,15 @@ __override_proto void pd_check_dr_role(int port,
int flags);
/**
+ * Check for a potential Vconn swap if the port isn't
+ * supplying Vconn
+ *
+ * @param port USB-C port number
+ * @param flags PD flags
+ */
+__override_proto void pd_try_execute_vconn_swap(int port, int flags);
+
+/**
* Check if we should charge from this device. This is
* basically a white-list for chargers that are dual-role,
* don't set the unconstrained bit, but we should charge