提交 0908c5ac 编写于 作者: K Kyle Tso 提交者: Greg Kroah-Hartman

usb: typec: tcpm: AMS and Collision Avoidance

This patch provides the implementation of Collision Avoidance introduced
in PD3.0. The start of each Atomic Message Sequence (AMS) initiated by
the port will be denied if the current AMS is not interruptible. The
Source port will set the CC to SinkTxNG if it is going to initiate an
AMS, and SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port
will be denied in TCPM if the port partner (Source) sets SinkTxNG except
for HARD_RESET and SOFT_RESET.
Tested-by: NHans de Goede <hdegoede@redhat.com>
Reviewed-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: NKyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210114145053.1952756-2-kyletso@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7a79f1f7
此差异已折叠。
...@@ -479,6 +479,7 @@ static inline unsigned int rdo_max_power(u32 rdo) ...@@ -479,6 +479,7 @@ static inline unsigned int rdo_max_power(u32 rdo)
#define PD_T_NEWSRC 250 /* Maximum of 275ms */ #define PD_T_NEWSRC 250 /* Maximum of 275ms */
#define PD_T_SWAP_SRC_START 20 /* Minimum of 20ms */ #define PD_T_SWAP_SRC_START 20 /* Minimum of 20ms */
#define PD_T_BIST_CONT_MODE 50 /* 30 - 60 ms */ #define PD_T_BIST_CONT_MODE 50 /* 30 - 60 ms */
#define PD_T_SINK_TX 16 /* 16 - 20 ms */
#define PD_T_DRP_TRY 100 /* 75 - 150 ms */ #define PD_T_DRP_TRY 100 /* 75 - 150 ms */
#define PD_T_DRP_TRYWAIT 600 /* 400 - 800 ms */ #define PD_T_DRP_TRYWAIT 600 /* 400 - 800 ms */
......
...@@ -19,6 +19,10 @@ enum typec_cc_status { ...@@ -19,6 +19,10 @@ enum typec_cc_status {
TYPEC_CC_RP_3_0, TYPEC_CC_RP_3_0,
}; };
/* Collision Avoidance */
#define SINK_TX_NG TYPEC_CC_RP_1_5
#define SINK_TX_OK TYPEC_CC_RP_3_0
enum typec_cc_polarity { enum typec_cc_polarity {
TYPEC_POLARITY_CC1, TYPEC_POLARITY_CC1,
TYPEC_POLARITY_CC2, TYPEC_POLARITY_CC2,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册