summaryrefslogtreecommitdiff
path: root/driver/tcpm/stub.c
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2015-07-30 15:10:11 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-21 08:10:03 +0000
commitd862dd05982198a2f5d450820a02172e0ba6396b (patch)
treec9c96e5ea91537a3aae99370952eb2a13156a1af /driver/tcpm/stub.c
parent646760bb20fde94683d3be2fa4b046d47933d85f (diff)
downloadchrome-ec-d862dd05982198a2f5d450820a02172e0ba6396b.tar.gz
pd: Enable detection of VBUS via the TCPM/TCPCI interface
Modified TCPC layer to utilize the Power_Status and Power_Status_Mask registers. VBUS status is stored in Power_Status and when a change is detected, it's communicated to the TCPM via the ALERT# line. BUG=chrome-os-partner:43440 BRANCH=none TEST=Tested the feature on Glados and Oak connecting to both Ziger and Samus. Verfied that VBUS status is communicated via the TCPCI and that PD contracts are established without using the VBUS_WAKE GPIO lines on Glados and Oak. Change-Id: Ie5aa32eecc887f3cb00880a285f1e710b7064384 Signed-off-by: Scott Collyer <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/289931 Reviewed-by: Rong Chang <rongchang@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'driver/tcpm/stub.c')
-rw-r--r--driver/tcpm/stub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/driver/tcpm/stub.c b/driver/tcpm/stub.c
index 444730fc18..35f0329484 100644
--- a/driver/tcpm/stub.c
+++ b/driver/tcpm/stub.c
@@ -16,6 +16,7 @@ extern int tcpc_alert_mask_set(int port, uint16_t mask);
extern int tcpc_get_cc(int port, int *cc1, int *cc2);
extern int tcpc_set_cc(int port, int pull);
extern int tcpc_set_polarity(int port, int polarity);
+extern int tcpc_set_power_status_mask(int port, uint8_t mask);
extern int tcpc_set_vconn(int port, int enable);
extern int tcpc_set_msg_header(int port, int power_role, int data_role);
extern int tcpc_set_rx_enable(int port, int enable);
@@ -63,6 +64,11 @@ int tcpm_set_polarity(int port, int polarity)
return tcpc_set_polarity(port, polarity);
}
+int tcpm_set_power_status_mask(int port, uint8_t mask)
+{
+ return tcpc_set_power_status_mask(port, mask);
+}
+
int tcpm_set_vconn(int port, int enable)
{
return tcpc_set_vconn(port, enable);