diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2009-05-19 10:08:03 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 18:21:10 -0300 |
commit | 04a37e0f32f9882430bc1899899d2ed91b8aaf5b (patch) | |
tree | 65af84e6e1165d1878d34c4a3dcefce881f3b955 /drivers/media/video/uvc/uvcvideo.h | |
parent | b2d9cc4226fa512aa36fd78738f5069dfce0583d (diff) | |
download | talos-obmc-linux-04a37e0f32f9882430bc1899899d2ed91b8aaf5b.tar.gz talos-obmc-linux-04a37e0f32f9882430bc1899899d2ed91b8aaf5b.zip |
V4L/DVB (11837): uvcvideo: Start status polling on device open
Most UVC camera include an interrupt endpoint to report control value changes,
video streaming errors and camera button events. The USB controller
continuously polls the interrupt endpoint to retrieve such events. This
prevents the device from being auto-suspended, and thus consumes power.
Reporting video streaming errors don't make sense when the V4L2 device is
closed. Control value changes are probably useless as well if nobody listens to
the events, although caching will probably have to be completely disabled then.
No polling is thus be required when /dev/videoX is not opened.
To enable auto-suspend and save power do not poll the interrupt endpoint until
the device is open. We lose the ability to detect button events if no
application is using the camera.
http://bugzilla.kernel.org/show_bug.cgi?id=11948
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvcvideo.h')
-rw-r--r-- | drivers/media/video/uvc/uvcvideo.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index e5014e668f99..daf074447304 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h @@ -634,6 +634,7 @@ struct uvc_device { enum uvc_device_state state; struct kref kref; struct list_head list; + atomic_t users; /* Video control interface */ __u16 uvc_version; @@ -770,6 +771,8 @@ extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit, /* Status */ extern int uvc_status_init(struct uvc_device *dev); extern void uvc_status_cleanup(struct uvc_device *dev); +extern int uvc_status_start(struct uvc_device *dev); +extern void uvc_status_stop(struct uvc_device *dev); extern int uvc_status_suspend(struct uvc_device *dev); extern int uvc_status_resume(struct uvc_device *dev); |