extcon: usbc-tusb320: add accessory detection support
authorAlvin Šipraga <alsi@bang-olufsen.dk>
Sat, 18 Mar 2023 15:05:53 +0000 (16:05 +0100)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 29 May 2023 14:31:25 +0000 (23:31 +0900)
commit18eb81d804c41c98b7e831560ebb933375496529
tree519202c64b8680a7f14221c0997baab2b9a4c19f
parent04151575c507e7ea3aa6dee73ff9970d699641d3
extcon: usbc-tusb320: add accessory detection support

The TUSB320 can detect the following types of accessory:

  - Audio Accessory
  - Audio Accessory with charge-thru
  - Debug Accessory (DFP)
  - Debug Accessory (UFP)

Moreover, the typec subsystem can be informed of this through the
typec_set_mode() function. The information will be propagated to any
linked typec muxes. Add the necessary support to the driver.

Note that for the Debug Accessory modes, an educated guess was made that
for the USB data role, DFP implies HOST and UFP implies DEVICE. But this
might want to be made configurable at a later date.

Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-usbc-tusb320.c