usb: typec: altmodes: add typec_cable_ops to typec_altmode
authorRD Babiera <rdbabiera@google.com>
Mon, 8 Jan 2024 19:16:14 +0000 (19:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:38:25 +0000 (17:38 -0800)
commit7494d4bc8e32a9480fd56b018db8e404b54b24e6
tree84c72dd4e94804810559f129c7210d99e7c86597
parent9f60a0cfa8fb8aa66262638771e9e9804efa490e
usb: typec: altmodes: add typec_cable_ops to typec_altmode

Add typec_cable_ops struct for enter, exit, and vdm. The struct is added
to typec_altmode so port alt modes can have access to partner and cable
specific callbacks, and alt mode drivers can specify operations over SOP'
and SOP'' without modifying the existing API.

typec_port_register_cable_ops is added as a new symbol for port drivers
to use to register cable operations to their registered port alt modes.

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-15-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/bus.c
drivers/usb/typec/class.c
include/linux/usb/typec.h
include/linux/usb/typec_altmode.h