diff mbox series

[15/15] usb: typec: ucsi: Store the supported USB modes

Message ID 20191230142611.24921-16-heikki.krogerus@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series USB Type-C changes | expand

Commit Message

Heikki Krogerus Dec. 30, 2019, 2:26 p.m. UTC
UCSI can tell does the port support USB2 and USB3 modes, but
it can not tell is USB4 supported even when it is.
Nevertheless, registering the ports with the USB2 and USB3
capability set correctly for now.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 4459bc68aa33..4b23d271fed7 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -809,6 +809,11 @@  static int ucsi_register_port(struct ucsi *ucsi, int index)
 	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_DEBUG_ACCESSORY)
 		*accessory = TYPEC_ACCESSORY_DEBUG;
 
+	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_USB2)
+		cap->usb |= USB_CAPABILITY_USB2;
+	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_USB3)
+		cap->usb |= USB_CAPABILITY_USB3;
+
 	cap->fwnode = ucsi_find_fwnode(con);
 	cap->driver_data = con;
 	cap->ops = &ucsi_ops;