summaryrefslogtreecommitdiff
path: root/include/usb_pe_sm.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2022-12-12 17:27:50 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-10 00:19:04 +0000
commitb44e58aadac1c4ceeea3bfe0fd988fa1599156c9 (patch)
treec4a4974a4b2bbbc64c456af90bbbf2b8a2a83d2f /include/usb_pe_sm.h
parenta362f8c342528a372d2acaa9fbb1883b8b5a0ec5 (diff)
downloadchrome-ec-b44e58aadac1c4ceeea3bfe0fd988fa1599156c9.tar.gz
USB-PD: Add EPR sink capability to TCPMv2
This patch adds EPR capability for a sink port in TCPMv2. Done: - PE_SNK_EPR_Mode_Entry - PE_SNK_EPR_Mode_Wait_For_Response - PE_SNK_EPR_Mode_Exit - PE_SNK_EPR_Mode_Exit_Received - PE_SNK_EPR_Keep_Alive - EPR_Source_Capabilities message (6.5.15.2) - EPR_Request message (6.4.9) - EPR exit initiated by Sink (6.4.10.3) - EPR exit initiated by Source (2.8 step 6.a) The following features are not included: - EPR_Get_Sink_Cap message (6.5.14.2) & EPR_Sink_Capabilities message (6.5.15.3) - EPR_Get_Source_Cap message (6.5.14.1) - EPR adjustable voltage supply in APDO (6.4.1.2.5.2) - Stop SinkEPRKeepAliveTimer whenever - GoodCRC is transmitted in response to any message from source. - GoodCRC is received in response to any message sent to source. - Make EC_CMD_TYPEC_STATUS host 11 PDOs. - Implicit Exit (6.4.10.3.2) - Exits due to errors (6.4.10.3.3) References: 6.4.10 EPR_Mode Message (ERPMDO) 8.3.2.2.2.1.1 Entering EPR Mode (Success) 8.3.2.2.2.5.1 Exiting EPR Mode (Sink Initiated) 8.3.3 Policy Engine Sink Port State Diagram 8.3.3.27.2 Sink EPR Mode Entry State Diagram 8.3.3.27.4 Sink EPR Mode Exit State Diagram BRANCH=None BUG=b:257320026 TEST=Agah. Run 'pd 1 epr enter/exit' with Apple and Anker charger. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I54c711865a51cc18460feace21d04144c7420b06 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290370 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include/usb_pe_sm.h')
-rw-r--r--include/usb_pe_sm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/usb_pe_sm.h b/include/usb_pe_sm.h
index f8d20a0394..9672c6b26b 100644
--- a/include/usb_pe_sm.h
+++ b/include/usb_pe_sm.h
@@ -201,4 +201,20 @@ void pe_clear_ado(int port);
void pe_clear_port_data(int port);
#endif /* TEST_BUILD */
+/**
+ * Check whether the port is in EPR mode or not.
+ *
+ * @param port USB-C port number
+ * @return true if the port is in EPR mode or false.
+ */
+bool pe_snk_in_epr_mode(int port);
+
+/**
+ * Checks whether the port is ready for EPR entry.
+ *
+ * @param port USB-C port number
+ * @return true if the port can enter EPR mode or false.
+ */
+bool pe_snk_can_enter_epr_mode(int port);
+
#endif /* __CROS_EC_USB_PE_H */