Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a413619a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: gadget: Add support for superspeed plus for UAC2 & UVC"

parents a81ab23e 139e5a04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -629,7 +629,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
	hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress;

	ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc,
					ss_audio_desc, NULL);
					ss_audio_desc, ss_audio_desc);
	if (ret)
		return ret;

+12 −2
Original line number Diff line number Diff line
@@ -488,6 +488,7 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
	void *mem;

	switch (speed) {
	case USB_SPEED_SUPER_PLUS:
	case USB_SPEED_SUPER:
		uvc_control_desc = uvc->desc.ss_control;
		uvc_streaming_cls = uvc->desc.ss_streaming;
@@ -531,7 +532,7 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
	      + uvc_control_ep.bLength + uvc_control_cs_ep.bLength
	      + uvc_streaming_intf_alt0.bLength;

	if (speed == USB_SPEED_SUPER) {
	if (speed >= USB_SPEED_SUPER) {
		bytes += uvc_ss_control_comp.bLength;
		n_desc = 6;
	} else {
@@ -575,7 +576,7 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
	uvc_control_header->baInterfaceNr[0] = uvc->streaming_intf;

	UVC_COPY_DESCRIPTOR(mem, dst, &uvc_control_ep);
	if (speed == USB_SPEED_SUPER)
	if (speed >= USB_SPEED_SUPER)
		UVC_COPY_DESCRIPTOR(mem, dst, &uvc_ss_control_comp);

	UVC_COPY_DESCRIPTOR(mem, dst, &uvc_control_cs_ep);
@@ -729,6 +730,15 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
			goto error;
		}
	}
	if (gadget_is_superspeed_plus(c->cdev->gadget)) {
		f->ssp_descriptors = uvc_copy_descriptors(uvc,
						USB_SPEED_SUPER_PLUS);
		if (IS_ERR(f->ssp_descriptors)) {
			ret = PTR_ERR(f->ssp_descriptors);
			f->ssp_descriptors = NULL;
			goto error;
		}
	}

	/* Preallocate control endpoint request. */
	uvc->control_req = usb_ep_alloc_request(cdev->gadget->ep0, GFP_KERNEL);