aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/v4l2-dev.c
AgeCommit message (Collapse)Author
2009-01-22MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatc ↵merge
hes-tracking-fix-stray-endmenu-patch-1232632040-1232632141 pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
2008-10-12V4L/DVB (9133): v4l: disconnect kernel number from minorHans Verkuil
The v4l core creates four different video devices (video, vbi, radio, vtx) and each has its own range of minor numbers. However, modern devices keep increasing the number of devices that they need so a maximum of 64 video devices will not be enough in the future. In addition this scheme makes it very hard to add new device types. This patch disconnects the kernel number allocation (e.g. video0, video1, etc.) from the actual minor number (just pick the first free minor). This allows for much more flexibility in the future. However, it does require the use of udev. For those who cannot use udev a new CONFIG option was created that changes the allocation scheme back to the old behavior. Thanks to Greg KH for suggesting this approach during the 2008 LPC. In addition, several bugs were fixed in the ivtv and cx18 drivers: these drivers try to allocate specific kernel numbers but that scheme contained a bug which caused what should have been e.g. video17 to appear as e.g. video2. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8857): v4l2-dev: replace panic with BUGHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8852): v4l2: use register_chrdev_region instead of register_chrdevHans Verkuil
Replace the old register_chrdev with the more flexible register_chrdev_region. Ensure that the release() is called when the very last chardev usage was released, and not when the sysfs devices were removed. This should simplify hotpluggable drivers considerably. Tested-by: Mike Isely <isely@isely.net> Tested-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: David Ellingsworth <david@identd.dyndns.org> Reviewed-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8791): v4l2-dev: do not clear the driver_data fieldHans Verkuil
The driver_data field of the device structure was zeroed, thus losing this information. Many drivers set this up before calling video_device_register, so we have to ensure that it isn't lost. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8787): v4l2-dev: cleanups and add video_drvdata helper functionHans Verkuil
Cleanup v4l2-dev.[ch], add/improve comments and add a new helper function: video_drvdata() that can get the private driver data from a file struct. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8784): v4l2-dev: make the video_device's release callback mandatoryHans Verkuil
Now that all drivers set the release callback in the video_device struct we can put in a BUG_ON in video_register_device to ensure that the callback is always there. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8782): v4l2-dev: add video_device_release_emptyHans Verkuil
Add a second release function: video_device_release_empty It can be used by drivers that have statically allocated video_device structs. Its use usually, but not always, indicates laziness on the part of the driver programmer. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8781): v4l2-dev: remove obsolete video_exclusive_open/releaseHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8750): V4L: check inval in video_register_device_index()Henrik Kretzschmar
Better check the video_device pointer before using it. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8613): v4l: move BKL down to the driver level.Hans Verkuil
The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03V4L/DVB (8750): V4L: check inval in video_register_device_index()Henrik Kretzschmar
Better check the video_device pointer before using it. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03V4L/DVB (8682): V4L: fix return value of register video funcHenrik Kretzschmar
If a wrong device type is used with video_register_device_index() it should better return an error number, instead of a constant. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-08-06V4L/DVB (8549a): fix kernel-doc warning, function name, and docbook filenameRandy Dunlap
Change function name in kernel-doc and add kernel-doc for parameter @index: Warning(linhead//drivers/media/video/videodev.c:2090): No description found for parameter 'index' Also change source file name in DocBook/videobook.tmpl to match the new source file name. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil
The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23V4L/DVB (8429): videodev: renamed 'class_dev' to 'dev'Hans Verkuil
The class_dev field is a normal device, not a class device. This is very confusing and now that the old 'dev' field has been renamed to 'parent' we can rename 'class_dev' to just 'dev'. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23V4L/DVB (8428): videodev: rename 'dev' to 'parent'Hans Verkuil
The field 'dev' is not the video device, but the parent of the video device. Rename accordingly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23V4L/DVB (8427): videodev: split off the ioctl handling into v4l2-ioctl.cHans Verkuil
videodev.c became top-heavy so all the ioctl processing has been split off into v4l2-ioctl.c. This means videodev.c is back to its original purpose: creating and registering v4l devices. Since videodev.c and v4l2-ioctl.c should still remain one module (as least for now) I also had to rename videodev.c to v4l2-dev.c to prevent a circular dependency when building a videodev.ko module. This is not a bad thing, since the source and header now have the same name. And the v4l2- prefix is useful to see which sources are generic v4l2 support code. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>