Re: [PATCH] uvcvideo: add SetInterface(0) in .reset_resume handler

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

 



Hi Ming,

Thanks for the patch. I've queued it for v3.2 with a small modification (the 
usb_set_interface() call has been moved to uvc_video.c).

On Saturday 16 July 2011 05:51:00 Ming Lei wrote:
> As commented in uvc_video_init,
> 
> 	/* Alternate setting 0 should be the default, yet the XBox Live Vision
> 	 * Cam (and possibly other devices) crash or otherwise misbehave if
> 	 * they don't receive a SET_INTERFACE request before any other video
> 	 * control request.
> 	 */
> 
> so it does make sense to add the SetInterface(0) in .reset_resume
> handler so that this kind of devices can work well if they are reseted
> during resume from system or runtime suspend.
> 
> We have found, without the patch, Microdia camera(0c45:6437) can't send
> stream data any longer after it is reseted during resume from
> system suspend.
> 
> Cc: Jeremy Kerr <jeremy.kerr@xxxxxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>
> ---
>  drivers/media/video/uvc/uvc_driver.c |   14 +++++++++++++-
>  1 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/uvc/uvc_driver.c
> b/drivers/media/video/uvc/uvc_driver.c index b6eae48..41c6d1a 100644
> --- a/drivers/media/video/uvc/uvc_driver.c
> +++ b/drivers/media/video/uvc/uvc_driver.c
> @@ -1959,8 +1959,20 @@ static int __uvc_resume(struct usb_interface *intf,
> int reset) }
> 
>  	list_for_each_entry(stream, &dev->streams, list) {
> -		if (stream->intf == intf)
> +		if (stream->intf == intf) {
> +			/*
> +			 * After usb bus reset, some devices may
> +			 * misbehave if SetInterface(0) is not done, for
> +			 * example, Microdia camera(0c45:6437) will stop
> +			 * sending streaming data. I think XBox Live
> +			 * Vision Cam needs it too, as commented in
> +			 * uvc_video_init.
> +			 */
> +			if (reset)
> +				usb_set_interface(stream->dev->udev,
> +					stream->intfnum, 0);
>  			return uvc_video_resume(stream);
> +		}
>  	}
> 
>  	uvc_trace(UVC_TRACE_SUSPEND, "Resume: video streaming USB interface "

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux