usb: typec: tcpci: add attempt_vconn_swap_discovery callback
authorRD Babiera <rdbabiera@google.com>
Mon, 8 Jan 2024 19:16:20 +0000 (19:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:38:25 +0000 (17:38 -0800)
commit030509ac473da439e3d5438b1cd3c5b899844046
treea65503164d13acce49593c2b0ed68697412401a3
parent6bd181ba60e198fef6f750b543832f161fbd9f39
usb: typec: tcpci: add attempt_vconn_swap_discovery callback

Add attempt_vconn_swap_discovery callback to determine whether the TCPM
should perform a Vconn swap following Discover Identity on SOP. The tcpci
will return false unless chip level drivers implement the callback.

Maxim based TCPCs will return true unless the last connection resulted in
a Vconn Over Current Fault, which may be the result of the Vconn swap. In
addition to the port resetting, the TCPCI will veto the next Vconn swap
from occurring.

Signed-off-by: RD Babiera <rdbabiera@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240108191620.987785-21-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci.c
drivers/usb/typec/tcpm/tcpci_maxim.h
drivers/usb/typec/tcpm/tcpci_maxim_core.c
include/linux/usb/tcpci.h
include/linux/usb/tcpm.h