Re: [linuxtv-commits] [hg:v4l-dvb] uvcvideo: Implement the USB power management reset_resume method.

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

 



On Saturday 30 August 2008 12:06:12 Laurent Pinchart wrote:
> Hi Hans,
>
> On Saturday 30 August 2008, Hans Verkuil wrote:
> > On Saturday 30 August 2008 11:09:00 Laurent Pinchart wrote:
> > > On Saturday 30 August 2008, Hans Verkuil wrote:
> > > > On Friday 29 August 2008 19:35:03 Patch from Laurent Pinchart 
wrote:
> > > > > The patch number 8754 was added via Mauro Carvalho Chehab
> > > > > <mchehab@xxxxxxxxxxxxx> to http://linuxtv.org/hg/v4l-dvb
> > > > > master development tree.
> > > > >
> > > > > Kernel patches in this development tree may be modified to be
> > > > > backward compatible with older kernels. Compatibility
> > > > > modifications will be removed before inclusion into the
> > > > > mainstream Kernel
> > > > >
> > > > > If anyone has any objections, please let us know by sending a
> > > > > message to: v4l-dvb-maintainer@xxxxxxxxxxx
> > > > >
> > > > > ------
> > > > >
> > > > > From: Laurent Pinchart  <laurent.pinchart@xxxxxxxxx>
> > > > > uvcvideo: Implement the USB power management reset_resume
> > > > > method.
> > > > >
> > > > >
> > > > > When a suspended device has been reset instead of being
> > > > > resumed, USB core calls the reset_resume method if available
> > > > > instead of unbinding and rebinding the device.
> > > > >
> > > > > This patch implements reset_resume by reusing the current
> > > > > resume implementation and simplifies the resume method by
> > > > > skipping the controls restore stage. Resuming from
> > > > > autosuspend should be faster.
> > > > >
> > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxx>
> > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>
> > > > >
> > > > >
> > > > > ---
> > > > >
> > > > >  linux/drivers/media/video/uvc/uvc_driver.c |   15
> > > > > +++++++++++++-- 1 file changed, 13 insertions(+), 2
> > > > > deletions(-)
> > > > >
> > > > > diff -r 00c2f04432f4 -r 2bcde9bb32b3
> > > > > linux/drivers/media/video/uvc/uvc_driver.c ---
> > > > > a/linux/drivers/media/video/uvc/uvc_driver.c	Fri Aug 29
> > > > > 14:31:32 2008 -0300 +++
> > > > > b/linux/drivers/media/video/uvc/uvc_driver.c	Fri Aug 22
> > > > > 22:25:10 2008 +0200 @@ -1663,7 +1663,7 @@ static int
> > > > > uvc_suspend(struct usb_interf return
> > > > > uvc_video_suspend(&dev->video); }
> > > > >
> > > > > -static int uvc_resume(struct usb_interface *intf)
> > > > > +static int __uvc_resume(struct usb_interface *intf, int
> > > > > reset) {
> > > > >  	struct uvc_device *dev = usb_get_intfdata(intf);
> > > > >  	int ret;
> > > > > @@ -1672,7 +1672,7 @@ static int uvc_resume(struct
> > > > > usb_interfa intf->cur_altsetting->desc.bInterfaceNumber);
> > > > >
> > > > >  	if (intf->cur_altsetting->desc.bInterfaceSubClass ==
> > > > > SC_VIDEOCONTROL) { -		if ((ret = uvc_ctrl_resume_device(dev))
> > > > > < 0) +		if (reset && (ret = uvc_ctrl_resume_device(dev)) < 0)
> > > > > return ret;
> > > > >
> > > > >  		return uvc_status_resume(dev);
> > > > > @@ -1685,6 +1685,16 @@ static int uvc_resume(struct
> > > > > usb_interfa }
> > > > >
> > > > >  	return uvc_video_resume(&dev->video);
> > > > > +}
> > > > > +
> > > > > +static int uvc_resume(struct usb_interface *intf)
> > > > > +{
> > > > > +	return __uvc_resume(intf, 0);
> > > > > +}
> > > > > +
> > > > > +static int uvc_reset_resume(struct usb_interface *intf)
> > > > > +{
> > > > > +	return __uvc_resume(intf, 1);
> > > > >  }
> > > > >
> > > > >  /*
> > > > > -------------------------------------------------------------
> > > > >---- ---- --- @@ -1952,6 +1962,7 @@ struct uvc_driver
> > > > > uvc_driver = { .disconnect	= uvc_disconnect,
> > > > >  		.suspend	= uvc_suspend,
> > > > >  		.resume		= uvc_resume,
> > > > > +		.reset_resume	= uvc_reset_resume,
> > > > >  		.id_table	= uvc_ids,
> > > > >  		.supports_autosuspend = 1,
> > > > >  	},
> > > > >
> > > > >
> > > > > ---
> > > > >
> > > > > Patch is available at:
> > > > > http://linuxtv.org/hg/v4l-dvb/rev/2bcde9bb32b34d0f8d1dac292b9
> > > > >ec63 8989 c2664
> > > >
> > > > Hi Laurent,
> > > >
> > > > The .reset_resume function didn't appear in the kernel until
> > > > 2.6.23, so now uvc fails to build with kernel 2.6.22. Should I
> > > > change the minimum kernel requirement of uvc to 2.6.23 or can
> > > > you work around this using a KERNEL_VERSION check?
> > >
> > > There's already a KERNEL_VERSION-based workaround available in
> > > the linux-uvc subversion repository. Is there a git tree I can
> > > generate a patch against ?
> >
> > Hi Laurent,
> >
> > We use mercurial, so for us it is easiest if you can provide a
> > patch against the master v4l-dvb repository:
> >
> > http://linuxtv.org/hg/v4l-dvb/
> >
> > Or just download http://linuxtv.org/hg/v4l-dvb/archive/tip.tar.bz2
> > and provide a patch against that.
>
> http://linuxtv.org/hg/v4l-dvb/archive/tip.tar.bz2 seems to be broken.

Hmm, it worked before, something broke indeed. Luckily the gz archive is 
OK:

http://linuxtv.org/hg/v4l-dvb/archive/tip.tar.gz

The alternative is to install mercurial and run:

hg clone http://linuxtv.org/hg/v4l-dvb

Regards,

	Hans

_______________________________________________
v4l-dvb-maintainer mailing list
v4l-dvb-maintainer@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/v4l-dvb-maintainer

[Index of Archives]     [Linux Media]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [SSH]     [Linux USB]

  Powered by Linux