usb: typec: altmodes: add svdm version info for typec cables
authorRD Babiera <rdbabiera@google.com>
Mon, 8 Jan 2024 19:16:15 +0000 (19:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:38:25 +0000 (17:38 -0800)
commit231b7318413cef0f8e5c2ca8db1a95b666c25d70
tree2b0bab45fde86698a4a09bae2b2b39d7315c62fc
parent7494d4bc8e32a9480fd56b018db8e404b54b24e6
usb: typec: altmodes: add svdm version info for typec cables

Add typec_cable_set_svdm_version and typec_get_cable_svdm version symbols.
Cables can operate under a lower PD revision than the port partner, and the
max SVDM version is tied to the PD revision. So, typec_cable maintains its
own svdm_version.

Add typec_altmode_get_cable_svdm_version to return the cable's negotiated
svdm_version for altmode drivers to use.

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