summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpm.h
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2019-12-11 16:04:03 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-08 17:15:04 +0000
commitb560141a1d8ce034ae5b85718c163fb7ab83c24f (patch)
tree1b0505d2eeaa5bc7c1f521e6fed1015e9ab2d023 /include/usb_pd_tcpm.h
parent5750cc926d64033fe7f19b760165011120915ab0 (diff)
downloadchrome-ec-b560141a1d8ce034ae5b85718c163fb7ab83c24f.tar.gz
tcpci: Only drive one CC line when attached
Some of the NCT38XX driver code was more generic TCPCI than specific to the chip. So moved a number of the functions over to be generically handled. In doing this I propagated the idea of tri-state polarity. It is now either NORMAL, FLIPPED, or NONE for unattached. This is needed for the generic handling of correctly setting CC. This required changing the polarity from NONE to the appropriate detected polarity when in auto toggle. tcpci_tcpm_set_cc will now only set a single CC line when attached and both when unattached. BUG=b:146003980, chromium:951681 BRANCH=none TEST=Charging works with both plug orientations with AP on TEST=Device works with both plug orientations with AP on TEST=Charging works with both plug orientations with AP off Change-Id: Ie4b5cc998902a346a4f4a2c1480204b3a81017dd Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1967932 Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r--include/usb_pd_tcpm.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 70ef7a17cb..9d6cbec160 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -49,6 +49,12 @@ enum tcpc_rp_value {
TYPEC_RP_RESERVED = 3,
};
+enum tcpc_cc_polarity {
+ POLARITY_NONE = -1,
+ POLARITY_CC1 = 0,
+ POLARITY_CC2 = 1,
+};
+
enum tcpm_transmit_type {
TCPC_TX_SOP = 0,
TCPC_TX_SOP_PRIME = 1,
@@ -189,17 +195,17 @@ struct tcpm_drv {
* Set polarity
*
* @param port Type-C port number
- * @param polarity 0=> transmit on CC1, 1=> transmit on CC2
+ * @param polarity port polarity
*
* @return EC_SUCCESS or error
*/
- int (*set_polarity)(int port, int polarity);
+ int (*set_polarity)(int port, enum tcpc_cc_polarity polarity);
/**
* Set Vconn.
*
* @param port Type-C port number
- * @param polarity Polarity of the CC line to read
+ * @param enable Enable/Disable Vconn
*
* @return EC_SUCCESS or error
*/