summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpm.h
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-04-04 10:38:50 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-10 19:12:48 -0700
commitdb8d6edf26ba3f78bbab2bcda7a98e249331b8c1 (patch)
tree8b15d0b02d9728dfab674cd65e0c7e27ba8c69b9 /include/usb_pd_tcpm.h
parentc8814430d65c440950446c573db0932707f02c89 (diff)
downloadchrome-ec-db8d6edf26ba3f78bbab2bcda7a98e249331b8c1.tar.gz
ppc: Add tcpci snk/src control via the COMMAND register
The ANX7447 has a sink/source control lines which can be connected to a PPC. The NX20P3483 PPC requires this control to set it's sink/source switch control. The ANX7447 contols these lines via the tcpci COMMAND register. This CL adds new tcpm_set functions to set either SNK or SRC control via the COMMAND register. BUG=b:77583452 BRANCH=NONE TEST=Tested on port 0 of Yorp with an external charger. Prior to this CL the PPC would remain in standby state because both snk/src control remained low. With these changes, verifed that snk_ctrl is driven high and vbus_sink_enable() function no longer returns an error. Change-Id: Icbea0d3edb63ad19f3d2c76636208497b6939a72 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/996239 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r--include/usb_pd_tcpm.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index d8ad743caa..1b77e40450 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -220,6 +220,28 @@ struct tcpm_drv {
*/
int (*get_chip_info)(int port, int renew,
struct ec_response_pd_chip_info **info);
+
+#ifdef CONFIG_USBC_PPC
+ /**
+ * Send SinkVBUS or DisableSinkVBUS command
+ *
+ * @param port Type-C port number
+ * @enable true for enable, false for disable
+ *
+ * @return EC_SUCCESS or error
+ */
+ int (*set_snk_ctrl)(int port, int enable);
+
+ /**
+ * Send SourceVBUS or DisableSourceVBUS command
+ *
+ * @param port Type-C port number
+ * @enable true for enable, false for disable
+ *
+ * @return EC_SUCCESS or error
+ */
+ int (*set_src_ctrl)(int port, int enable);
+#endif
};
enum tcpc_alert_polarity {