android_kernel_msm-6.1_noth.../include/linux/usb
Badhri Jagan Sridharan 8dc4bd0736 usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)
PD 3.0 spec defines a new mechanism for power role swap called
Fast role swap. This change enables TCPM to support FRS when
acting as sink.

Once the explicit contract is negotiated, sink port is
expected to query the source port for sink caps to
determine whether the source is FRS capable.
Bits 23 & 24 of fixed pdo of the sink caps from the source, when
set, indicates the current needed by the source when fast role
swap is in progress(Implicit contract phasae). 0 indicates that
the source does not support Fast Role Swap.

Upon receiving the FRS signal from the source,
TCPC(TCPM_FRS_EVENT) informs TCPM to start the Fast role swap sequence.

1. TCPM sends FRS PD message: FR_SWAP_SEND
2. If response is not received within the expiry of
   SenderResponseTimer, Error recovery is triggered.:
   FR_SWAP_SEND_TIMEOUT
3. Upon receipt of the accept message, TCPM waits for
   PSSourceOffTimer for PS_READY message from the partner:
   FR_SWAP_SNK_SRC_NEW_SINK_READY.

TCPC is expected to autonomously turn on vbus once the FRS
signal is received and vbus voltage falls below vsafe5v within
tSrcFrSwap. This is different from traditional power role swap
where the vbus sourcing is turned on by TCPM.

4. By this time, TCPC most likely would have started to
   source vbus, TCPM waits for tSrcFrSwap to see  if the
   lower level TCPC driver signals TCPM_SOURCING_VBUS event:
   FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED.
5. When TCPC signals sourcing vbus, TCPM sends PS_READY msg and
   changes the CC pin from Rd to Rp. This is the end of fast
   role swap sequence and TCPM initiates the sequnce to negotiate
   explicit contract by transitioning into SRC_STARTUP after
   SwapSrcStart.

The code is written based on the sequence described in "Figure 8-107:
Dual-role Port in Sink to Source Fast Role Swap State Diagram" of
USB Power Delivery Specification Revision 3.0, Version 1.2.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201008061556.1402293-7-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-08 09:28:22 +02:00
..
audio-v2.h sound updates for 5.7-rc1 2020-04-02 15:50:04 -07:00
audio-v3.h
audio.h
c67x00.h
ccid.h
cdc-wdm.h
cdc.h
cdc_ncm.h cdc_ncm: Implement the 32-bit version of NCM Transfer Block 2020-03-11 22:59:31 -07:00
ch9.h USB: Fix up terminology in include files 2020-07-02 23:01:11 +02:00
chipidea.h usb: chipidea: add query_available_role interface 2020-07-28 14:06:59 +08:00
composite.h usb: gadget: Fix issue with config_ep_by_speed function 2020-05-25 11:09:44 +03:00
ehci-dbgp.h
ehci_def.h
ehci_pdriver.h
ezusb.h
functionfs.h
g_hid.h
gadget.h USB: UDC: Expand device model API interface 2020-10-02 09:57:41 +03:00
gadget_configfs.h
hcd.h usb: hci: add hc_driver as argument for usb_hcd_pci_probe 2020-05-15 15:44:34 +02:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
isp1760.h
m66592.h
musb-ux500.h
musb.h
net2280.h
of.h
ohci_pdriver.h
otg-fsm.h
otg.h
pd.h usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS) 2020-10-08 09:28:22 +02:00
pd_ado.h
pd_bdo.h
pd_ext_sdb.h
pd_vdo.h usb: linux/usb/pd_vdo.h: drop duplicated word in comment 2020-07-15 16:48:11 +02:00
phy.h
phy_companion.h USB: Replace HTTP links with HTTPS ones 2020-07-21 13:41:57 +02:00
quirks.h USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE 2020-06-19 08:58:37 +02:00
r8a66597.h
renesas_usbhs.h
rndis_host.h
role.h usb: roles: Allow the role switches to be named 2020-03-04 11:12:50 +01:00
serial.h USB-serial updates for 5.9-rc1 2020-07-28 17:33:10 +02:00
sl811.h
storage.h
tcpm.h usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS) 2020-10-08 09:28:22 +02:00
tegra_usb_phy.h
typec.h usb: typec: add typec_find_pwr_opmode 2020-10-02 15:30:31 +02:00
typec_altmode.h usb: typec: Combine the definitions for Accessory and USB modes 2020-07-01 14:06:25 +02:00
typec_dp.h
typec_mux.h usb: typec: mux: Allow the mux handles to be requested with fwnode 2020-03-04 11:12:49 +01:00
typec_tbt.h usb: typec: Add definitions for Thunderbolt 3 Alternate Mode 2020-03-04 11:13:30 +01:00
uas.h
ulpi.h
usb338x.h
usb_phy_generic.h
usbnet.h net: usbnet: export usbnet_set_rx_mode() 2020-07-17 12:42:47 -07:00
xhci-dbgp.h