aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-event.c
Commit message (Collapse)AuthorAgeFilesLines
* V4L/DVB: v4l2: add core serialization lockHans Verkuil2010-10-211-1/+8
| | | | | | | | | | | | | | | | | | Drivers can optionally set a pointer to a mutex in struct video_device. The core will use that to lock before calling open, read, write, unlocked_ioctl, poll, mmap or release. Updated the documentation as well and ensure that v4l2-event knows about the lock: it will unlock it before doing a blocking wait on an event and relock it afterwards. Ensure that the 'video_is_registered' check is done when the lock is held: a typical disconnect will take the lock as well before unregistering the device nodes, so to prevent race conditions the video_is_registered check should also be done with the lock held. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: event: Export the v4l2_event_init and v4l2_event_dequeue functionsLaurent Pinchart2010-05-191-0/+2
| | | | | | Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: V4L: Events: Replace bad WARN_ON() with assert_spin_locked()Sakari Ailus2010-05-191-1/+1
| | | | | | | | | | | | spin_is_locked() always returns zero when spinlock debugging is disabled on a single CPU machine. Replace WARN_ON() with assert_spin_locked(). Thanks to Laurent Pinchart for spotting this! Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: V4L: Events: Add backendSakari Ailus2010-05-191-0/+290
Add event handling backend to V4L2. The backend handles event subscription and delivery to file handles. Event subscriptions are based on file handle. Events may be delivered to all subscribed file handles on a device independent of where they originate from. Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>