瀏覽代碼

usb: gadget: composite: Configure the usb_ep for SuperSpeedPlus

Configure the usb_ep using the SuperSpeedPlus descriptors if connected
in SuperSpeedPlus.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
John Youn 9 年之前
父節點
當前提交
4eb8e32dab
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      drivers/usb/gadget/composite.c

+ 8 - 1
drivers/usb/gadget/composite.c

@@ -148,6 +148,13 @@ int config_ep_by_speed(struct usb_gadget *g,
 
 
 	/* select desired speed */
 	/* select desired speed */
 	switch (g->speed) {
 	switch (g->speed) {
+	case USB_SPEED_SUPER_PLUS:
+		if (gadget_is_superspeed_plus(g)) {
+			speed_desc = f->ssp_descriptors;
+			want_comp_desc = 1;
+			break;
+		}
+		/* else: Fall trough */
 	case USB_SPEED_SUPER:
 	case USB_SPEED_SUPER:
 		if (gadget_is_superspeed(g)) {
 		if (gadget_is_superspeed(g)) {
 			speed_desc = f->ss_descriptors;
 			speed_desc = f->ss_descriptors;
@@ -191,7 +198,7 @@ ep_found:
 	    (comp_desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP))
 	    (comp_desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP))
 		return -EIO;
 		return -EIO;
 	_ep->comp_desc = comp_desc;
 	_ep->comp_desc = comp_desc;
-	if (g->speed == USB_SPEED_SUPER) {
+	if (g->speed >= USB_SPEED_SUPER) {
 		switch (usb_endpoint_type(_ep->desc)) {
 		switch (usb_endpoint_type(_ep->desc)) {
 		case USB_ENDPOINT_XFER_ISOC:
 		case USB_ENDPOINT_XFER_ISOC:
 			/* mult: bits 1:0 of bmAttributes */
 			/* mult: bits 1:0 of bmAttributes */