Re: [PATCH V3 1/5] usb: gadget/uvc: Fix VS_INPUT_HEADER.bEndpointAddress and Video Streaming.bEndpointAddress values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 08, 2013 at 11:48:18PM +0800, Bhupesh SHARMA wrote:
> Hi Laurent,
> 
> > Hi Bhupesh,
> > 
> > Thanks for the patch.
> > 
> > On Thursday 17 January 2013 16:23:49 Bhupesh Sharma wrote:
> > > This patch corrects the VS_INPUT_HEADER.bEndpointAddress and Video
> > > Streaming.bEndpointAddress values which were incorrectly set to 0 in
> > > UVC function driver.
> > >
> > > As 'usb_ep_autoconfig' function returns an un-claimed usb_ep, and
> > > modifies the endpoint descriptor's bEndpointAddress, so there is no
> > > need to again set the bEndpointAddress for Video Streaming and
> > > VS_INPUT_HEADER decriptors (for all speeds: SS/HS/FS) to the
> > > bEndpointAddress obtained for Full Speed case from 'usb_ep_autoconfig'
> > function call.
> > >
> > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@xxxxxx>
> > > ---
> > >  drivers/usb/gadget/f_uvc.c |   30 ++++++++++++++++++++----------
> > >  1 files changed, 20 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
> > > index b34349f..1769f3e 100644
> > > --- a/drivers/usb/gadget/f_uvc.c
> > > +++ b/drivers/usb/gadget/f_uvc.c
> > > @@ -550,8 +550,24 @@ uvc_copy_descriptors(struct uvc_device *uvc,
> > enum
> > > usb_device_speed speed) UVC_COPY_DESCRIPTORS(mem, dst,
> > >  		(const struct usb_descriptor_header**)uvc_streaming_cls);
> > >  	uvc_streaming_header->wTotalLength =
> > cpu_to_le16(streaming_size);
> > > -	uvc_streaming_header->bEndpointAddress =
> > > -		uvc_fs_streaming_ep.bEndpointAddress;
> > > +
> > > +	switch (speed) {
> > > +	case USB_SPEED_SUPER:
> > > +		uvc_streaming_header->bEndpointAddress =
> > > +			uvc_ss_streaming_ep.bEndpointAddress;
> > > +		break;
> > > +
> > > +	case USB_SPEED_HIGH:
> > > +		uvc_streaming_header->bEndpointAddress =
> > > +			uvc_hs_streaming_ep.bEndpointAddress;
> > > +		break;
> > > +
> > > +	case USB_SPEED_FULL:
> > > +	default:
> > > +		uvc_streaming_header->bEndpointAddress =
> > > +			uvc_fs_streaming_ep.bEndpointAddress;
> > > +		break;
> > > +	}
> > 
> > I don't think this will work. A superspeed device will see uvc_copy_descriptor
> > called 3 times, once for each speed. As only
> > uvc_ss_streaming_ep.bEndpointAddress is set in that case, high-speed and
> > full-speed descriptors will have a zero endpoint value.
> 
> Not exactly. The uvc_copy_descriptor is called only once for a superspeed device (at-least on my DWC3 UDC controller)
> depending on the highest speed exported by the UDC controller driver.
> 
> I have tested this patch with DWC3 controller driver and it works fine and I can confirm that my original patch works fine.
> Maybe someone else can test the same with his UDC controller driver. 
> 
> @Michael: Have you tested my original patch with your UDC controller and does it work fine at your end?

This patch is currently not on my stack. Until you send a new series
i will test them on the chipidea udc.

Thanks,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux