From: Ming Lei <tom.leiming@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
<linux-media@vger.kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Ming Lei <ming.lei@canonical.com>, <linux-usb@vger.kernel.org>,
Jeremy Kerr <jeremy.kerr@canonical.com>,
Mauro Carvalho Chehab <mchehab@redhat.com>
Subject: [PATCH] uvcvideo: add SetInterface(0) in .reset_resume handler
Date: Sat, 16 Jul 2011 11:51:00 +0800 [thread overview]
Message-ID: <20110716115100.10f6f764@tom-ThinkPad-T410> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1107151122490.1866-100000@iolanthe.rowland.org>
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@canonical.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
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 "
--
1.7.4.1
--
Ming Lei
next prev parent reply other threads:[~2011-07-16 3:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 9:48 [PATCH] uvcvideo: add fix suspend/resume quirk for Microdia camera Ming Lei
2011-07-11 10:44 ` Laurent Pinchart
2011-07-12 1:21 ` Ming Lei
2011-07-12 10:52 ` Ming Lei
2011-07-12 15:44 ` Alan Stern
2011-07-13 7:43 ` Ming Lei
2011-07-13 15:20 ` Alan Stern
2011-07-13 15:30 ` Ming Lei
2011-07-13 15:59 ` Alan Stern
2011-07-14 9:16 ` Ming Lei
2011-07-14 15:03 ` Alan Stern
2011-07-15 2:08 ` Ming Lei
2011-07-15 13:53 ` Ming Lei
2011-07-15 14:27 ` Alan Stern
2011-07-15 14:44 ` Ming Lei
2011-07-15 15:25 ` Alan Stern
2011-07-16 3:51 ` Ming Lei [this message]
2011-07-31 15:38 ` [PATCH] uvcvideo: add SetInterface(0) in .reset_resume handler Laurent Pinchart
2011-08-01 0:56 ` Ming Lei
2011-08-01 11:26 ` Laurent Pinchart
2011-08-01 17:39 ` Mauro Carvalho Chehab
2011-08-01 22:19 ` [GIT PATCH FOR v3.1] uvcvideo: Set alternate setting 0 on resume if the bus has been reset Laurent Pinchart
2011-07-13 8:35 ` [PATCH] uvcvideo: add fix suspend/resume quirk for Microdia camera Ming Lei
2011-07-13 8:38 ` Laurent Pinchart
2011-07-13 8:51 ` Ming Lei
2011-07-13 8:55 ` Oliver Neukum
2011-07-13 8:59 ` Laurent Pinchart
2011-07-13 9:07 ` Ming Lei
2011-07-11 10:51 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110716115100.10f6f764@tom-ThinkPad-T410 \
--to=tom.leiming@gmail.com \
--cc=jeremy.kerr@canonical.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=ming.lei@canonical.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.