diff options
author | RD Babiera <rdbabiera@google.com> | 2024-01-08 19:16:14 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-27 17:38:25 -0800 |
commit | 7494d4bc8e32a9480fd56b018db8e404b54b24e6 (patch) | |
tree | 84c72dd4e94804810559f129c7210d99e7c86597 /include/linux/usb/typec.h | |
parent | 9f60a0cfa8fb8aa66262638771e9e9804efa490e (diff) | |
download | linux-7494d4bc8e32a9480fd56b018db8e404b54b24e6.tar.gz linux-7494d4bc8e32a9480fd56b018db8e404b54b24e6.tar.bz2 linux-7494d4bc8e32a9480fd56b018db8e404b54b24e6.zip |
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>
Diffstat (limited to 'include/linux/usb/typec.h')
-rw-r--r-- | include/linux/usb/typec.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h index a05d6f6f2536..38f93d72fd1b 100644 --- a/include/linux/usb/typec.h +++ b/include/linux/usb/typec.h @@ -18,6 +18,7 @@ struct typec_cable; struct typec_plug; struct typec_port; struct typec_altmode_ops; +struct typec_cable_ops; struct fwnode_handle; struct device; @@ -157,6 +158,9 @@ void typec_port_register_altmodes(struct typec_port *port, const struct typec_altmode_ops *ops, void *drvdata, struct typec_altmode **altmodes, size_t n); +void typec_port_register_cable_ops(struct typec_altmode **altmodes, int max_altmodes, + const struct typec_cable_ops *ops); + void typec_unregister_altmode(struct typec_altmode *altmode); struct typec_port *typec_altmode2port(struct typec_altmode *alt); |