summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2019-11-05 18:47:47 +0000
committerCommit Bot <commit-bot@chromium.org>2019-11-06 21:49:53 +0000
commit1369d55f5e3cb9f0389c452b054d62fc74255c18 (patch)
tree4bfeacef7e4ecea4a126f9798b364e1b2f12417b /include
parentbdc0f13235d05c411a3ebd96eeb58f338cbff4da (diff)
downloadchrome-ec-1369d55f5e3cb9f0389c452b054d62fc74255c18.tar.gz
Revert "usbc: remove unnecessary tcpc CC reads"
This reverts commit bec03d91bc9f954682c02d122a0500d10cc102c2. Reason for revert: Some TCPC's bugs will generate an attach event when nothing is connected, triggering the state machine to enter an attached state. Example output with nothing connected to the port: 2019-10-28 10:23:20 [0.044393 C1: Unattached.SNK] 2019-10-28 10:23:20 [0.101264 p1: PPC init'd.] 2019-10-28 10:23:20 [0.106488 C1: Unattached.SRC] 2019-10-28 10:23:20 [0.116072 C1: AttachWait.SRC] 2019-10-28 10:23:20 [0.220006 C1: Attached.SRC] TOT has basic TypeC/PD functionality but issues still exist that will be fixed in subsequent CLs. Original change's description: > usbc: remove unnecessary tcpc CC reads > > We only need to read the CC pins when the CC evt is fired otherwise the > CC pins should have the same value. It is actually incorrect/undesirable > that our old PD stack queried the tpcp cc driver over i2c so frequently > for the CC pins status. > > Also single source code that interprets the CC lines values into a UFP > or DFP state. > > Lastly, remove extraneous timers for cc debouncing, we only need one. > > BRANCH=none > BUG=none > TEST=builds > > Change-Id: I65baa2e6fb92d7ab5ca12daa76225cd13b9ab974 > Signed-off-by: Jett Rink <jettrink@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1825504 > Reviewed-by: Denis Brockus <dbrockus@chromium.org> > Reviewed-by: Sam Hurst <shurst@google.com> > Commit-Queue: Denis Brockus <dbrockus@chromium.org> Bug: none Change-Id: Ie9bd366dd85df9a33934e06e4208543f6e7aaa9b Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1900058 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 183f40e7b0..57249bc312 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1116,6 +1116,9 @@ enum pd_states {
#define PD_BBRMFLG_DATA_ROLE BIT(2)
#define PD_BBRMFLG_VCONN_ROLE BIT(3)
+/* Initial value for CC debounce variable */
+#define PD_CC_UNSET -1
+
#ifdef CONFIG_USB_PD_DUAL_ROLE
enum pd_dual_role_states {
/* While disconnected, toggle between src and sink */
@@ -1256,7 +1259,8 @@ enum pd_power_role {
*/
enum pd_data_role {
PD_ROLE_UFP = 0,
- PD_ROLE_DFP = 1
+ PD_ROLE_DFP = 1,
+ PD_ROLE_DISCONNECTED = 2,
};
/*
@@ -2286,17 +2290,6 @@ void pd_notify_dp_alt_mode_entry(void);
enum pd_cc_states pd_get_cc_state(
enum tcpc_cc_voltage_status cc1, enum tcpc_cc_voltage_status cc2);
-/*
- * Optional, get the board-specific SRC DTS polarity.
- *
- * This function is used for SRC DTS mode. The polarity is predetermined as a
- * board-specific setting, i.e. what Rp impedance the CC lines are pulled.
- *
- * @param port USB-C port number
- * @return port polarity (0=CC1, 1=CC2)
- */
-__override_proto uint8_t board_get_src_dts_polarity(int port);
-
/* ----- Logging ----- */
#ifdef CONFIG_USB_PD_LOGGING
/**