summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpm.h
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2022-05-24 14:07:39 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-26 23:13:58 +0000
commitb1d76f2078c5d72347a442418c0e3f06129f5222 (patch)
treed1683ef7cd77a48df9e712d78ce80c4ca070de32 /include/usb_pd_tcpm.h
parent24dcbaf1a255324feb8f473972ba6dcc28468ae2 (diff)
downloadchrome-ec-b1d76f2078c5d72347a442418c0e3f06129f5222.tar.gz
tcpm: Support PD chips with SBU protection
Some PD chips have integrated port protection for SBU lines and the switches to enable the SBU lines coming out of the PD chip are controlled by vendor specific registers. Hence, added the code in TCPM & driver skeleton in TCPCI to support those chips. By checking if the SBU enable function exists in TCPM driver before trying to enable the SBU from discrete PPC, this code supports co-existence of both PD based SBU protection and discrete PPC chip SBU protection in a same platform. BUG=none BRANCH=none TEST=make buildall -j, zmake testall Change-Id: I3d3a5eec9077df95c0eb91cf1a709cb79f36ca60 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3227374 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r--include/usb_pd_tcpm.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 641c7afd5c..e34329eb18 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -426,6 +426,25 @@ struct tcpm_drv {
*/
int (*set_src_ctrl)(int port, int enable);
+#ifdef CONFIG_USB_PD_TCPM_SBU
+ /*
+ * Enable SBU lines.
+ *
+ * Some PD chips have integrated port protection for SBU lines and the
+ * switches to enable the SBU lines coming out of the PD chips are
+ * controlled by vendor specific registers. Hence, this function has to
+ * be written in vendor specific driver code and the board specific
+ * tcpc_config[] has to initialize the function with vendor specific
+ * function at board level.
+ *
+ * @param port Type-C port number
+ * @enable true for enable, false for disable
+ *
+ * @return EC_SUCCESS or error
+ */
+ int (*set_sbu)(int port, bool enable);
+#endif /* CONFIG_USB_PD_TCPM_SBU */
+
#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
/**
* Instructs the TCPC to enter into low power mode.