Files
android_kernel_xiaomi_sm8450/include/linux/usb/tcpm.h
Badhri Jagan Sridharan 750135f7ae FROMGIT: usb: typec: tcpm: Move TCPC to APPLY_RC state during PR_SWAP
When vbus auto discharge is enabled, TCPCI based TCPC transitions
into Attached.SNK/Attached.SRC state. During PR_SWAP, TCPCI based
TCPC would disconnect when partner changes power roles. TCPC has
to be moved APPLY RC state during PR_SWAP. This is done by
ROLE_CONTROL.CC1 != ROLE_CONTROL.CC2 and
POWER_CONTROL.AutodischargeDisconnect is 0. Once the swap sequence
is done, AutoDischargeDisconnect is re-enabled.

Bug: 185300749
Fixes: f321a02caebd ("usb: typec: tcpm: Implement enabling Auto Discharge disconnect support")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210517192112.40934-3-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 59d4d06c8ab0375dcc4bab329e6ecd44dd46373e
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I28b2307cb2c8ccaccc611303a95cfe00f9cae35a
2021-06-04 11:15:19 -07:00

7.2 KiB