diff mbox series

[v1,09/10] usb: typec: altmodes: add typec_altmode_get_cable_svdm_version

Message ID 20231207090738.15721-21-rdbabiera@google.com
State New
Headers show
Series usb: typec: add SOP' support to the tcpm and alt mode drivers | expand

Commit Message

RD Babiera Dec. 7, 2023, 9:07 a.m. UTC
Add typec_altmode_get_cable_svdm_version to return the cable's negotiated
svdm_version.

Signed-off-by: RD Babiera <rdbabiera@google.com>
---
 include/linux/usb/typec_altmode.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/usb/typec_altmode.h b/include/linux/usb/typec_altmode.h
index 4d527d92457d..1ad581c5a930 100644
--- a/include/linux/usb/typec_altmode.h
+++ b/include/linux/usb/typec_altmode.h
@@ -156,6 +156,16 @@  typec_altmode_get_svdm_version(struct typec_altmode *altmode)
 	return typec_get_negotiated_svdm_version(typec_altmode2port(altmode));
 }
 
+/**
+ * typec_altmode_get__cable_svdm_version - Get negotiated SVDM version for cable plug
+ * @altmode: Handle to the alternate mode
+ */
+static inline int
+typec_altmode_get_cable_svdm_version(struct typec_altmode *altmode)
+{
+	return typec_get_cable_svdm_version(typec_altmode2port(altmode));
+}
+
 /**
  * struct typec_altmode_driver - USB Type-C alternate mode device driver
  * @id_table: Null terminated array of SVIDs