aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videodev.c
Commit message (Collapse)AuthorAge
* drivers/media, include/media: delete zero-length filesJeff Garzik2008-07-31
| | | | Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* V4L/DVB (8427): videodev: split off the ioctl handling into v4l2-ioctl.cHans Verkuil2008-07-23
| | | | | | | | | | | | | | | 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>
* V4L/DVB (8414): videodev/cx18: fix get_index bug and error-handling lock-upsHans Verkuil2008-07-20
| | | | | | | | | Fix a bug in get_index that was introduced earlier. Also fix two error handling lock-ups in videodev and cx18 that where found thanks to that bug. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8390): videodev: add comment and remove magic number.Hans Verkuil2008-07-20
| | | | | Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8389): videodev: simplify get_index()Brandon Philips2008-07-20
| | | | | | | | | Use Hans Verkuil's suggested method of implementing get_index which doesn't depend on class_for_each_device and instead uses the video_device array. This simplifies the code and reduces its memory footprint. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8387): Some cosmetic changesHans Verkuil2008-07-20
| | | | | | | Those changes, together with some proper patches, will allow out-of-tree compilation for for kernels < 2.6.19 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8116): videodev: allow PRIVATE_BASE controls when called through ↵Hans Verkuil2008-07-20
| | | | | | | | | | | | | VIDIOC_G/S_CTRL. V4L2_CID_PRIVATE_BASE controls are not allowed when called from VIDIOC_S/G_EXT_CTRL as extended controls use a better mechanism for private controls. But still allow it when called from the VIDIOC_G/S_CTRL to extended control conversion in video_ioctl2() for backwards compatibility. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8112): videodev: improve extended control support in video_ioctl2()Hans Verkuil2008-07-20
| | | | | | | | | - add sanity checks for the extended controls argument. - if the driver only supports extended controls, then convert old-style controls to an extended control callback. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8103): videodev: fix/improve ioctl debuggingHans Verkuil2008-07-20
| | | | | | | | | | | | | | | | | Various ioctl debugging fixes and improvements: - use %x rather than %d for control IDs and bitmask fields - make two arrays const - show the whole control array for the ext_ctrl ioctls - print pix_fmt for V4L2_BUF_TYPE_VIDEO_OUTPUT - show full type name rather than an integer - fix CROPCAP debugging - fix G/S_TUNER debugging - show error code in case of an error - other small cleanups Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8083): videodev: zero fields for ENCODER_CMD and ↵Hans Verkuil2008-07-20
| | | | | | | | | VIDIOC_G_SLICED_VBI_CAP This avoids the need of memsets in the ivtv/cx18 drivers. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8078): Introduce "index" attribute for persistent video4linux ↵brandon@ifup.org2008-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | device nodes A number of V4L drivers have a mod param to specify their preferred minors. This is because it is often desirable for applications to have a static /dev name for a particular device. However, using minors has several disadvantages: 1) the requested minor may already be taken 2) using a mod param is driver specific 3) it requires every driver to add a param 4) requires configuration by hand This patch introduces an "index" attribute that when combined with udev rules can create static device paths like this: /dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video0 /dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video1 /dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video2 $ ls -la /dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video0 lrwxrwxrwx 1 root root 12 2008-04-28 00:02 /dev/v4l/by-path/pci-0000:00:1d.2-usb-0:1:1.0-video0 -> ../../video1 These paths are steady across reboots and should be resistant to rearranging across Kernel versions. video_register_device_index is available to drivers to request a specific index number. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Kees Cook <kees@outflux.net> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacksHans Verkuil2008-07-20
| | | | | | | | | The naming for the callbacks that handle the VIDIOC_ENUM_FMT and VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match the v4l2_buf_type name. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7948): videodev: add missing vidioc_try_fmt_sliced_vbi_output and ↵Hans Verkuil2008-07-20
| | | | | | | | | | | | | VIDIOC_ENUMOUTPUT handling There was no vidioc_try_fmt_sliced_vbi_output, instead vidioc_try_fmt_vbi_output was reused. The VIDIOC_ENUMOUTPUT handling was missing altogether, even though the callback existed. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7947): videodev: add vidioc_g_std callback.Hans Verkuil2008-07-20
| | | | | | | | The default videodev behavior for VIDIOC_G_STD is not correct for all devices. Add a new callback that drivers can use instead. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7946): videodev: small fixes for VIDIOC_G_FREQUENCY and VIDIOC_G_FMTHans Verkuil2008-07-20
| | | | | | | | __video_do_ioctl incorrectly zeroed the tuner field of v4l2_frequency and did not zero the full fmt union of v4l2_format. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7942): Hardware frequency seek ioctl interfaceTobias Lorenz2008-07-20
| | | | | Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* Merge commit 'v2.6.26' into bkl-removalJonathan Corbet2008-07-14
|\
| * V4L/DVB (8092): videodev: simplify and fix standard enumerationHans Verkuil2008-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | VIDIOC_ENUMSTD did not return all the PAL/SECAM/NTSC variants: it just returned one single PAL/SECAM/NTSC standard without separate entries for the trickier standards like NTSC-JP. Changed the code so that it behaves better. Also simplified the if/switch statements into a common standards lookup table. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* | videodev: BKL pushdownJonathan Corbet2008-06-20
|/ | | | | | | | Put explicit lock_kernel() calls into videodev_open(). That function itself seems OK, but one never knows about all the open() functions provided by underlying video drivers. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
* V4L/DVB (7665): videodev: Add default vidioc handlerDouglas Schilling Landgraf2008-04-24
| | | | | | | Added default vidioc handler for other private ioctls Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7560): videodev: Some printk fixesMauro Carvalho Chehab2008-04-24
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7558): videobuf: Improve command output for debug purposesMauro Carvalho Chehab2008-04-24
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7518): media/video/ replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-24
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7133): Fix Kconfig dependenciesMauro Carvalho Chehab2008-02-18
| | | | | | | | | | | | | | | | | As pointed by Adrian Bunk, with I2C=m and VIDEO_DEV=y, videodev brokes. This patch moves the functions that videodev needs from v4l2-common. It also fixes some Kconfig changes. After this patch, I2C=m / VIDEO_DEV=y will make v4l2 core statically linked into kernel. v4l2-common will be m, and all V4L drivers will also be m. This approach is very conservative, since it is possible to have V4L drivers that don't need I2C or v4l2-common. The better is to map what drivers really need v4l2-common, making them to select v4l2-common, and allowing the others to be 'y', 'm' and 'n'. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6805): video std is a bitmask. Better to print in hexaMauro Carvalho Chehab2008-01-25
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctlsHans Verkuil2007-10-22
| | | | | | | | Remove the obsolete VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls from the V4L2 API as per the removal schedule (October 2007). Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6300): CodingStyle cleanupTrent Piepho2007-10-09
| | | | | Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6293): V4L: convert struct class_device to struct deviceKay Sievers2007-10-09
| | | | | | | | | | | | The currently used "struct class_device" will be removed from the kernel. Here is a patch that converts all users in drivers/media/video/ to struct device. Reviewed-by: Thierry Merle <thierry.merle@free.fr> Reviewed-by: Mike Isely <isely@pobox.com> Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5982): Dev.c: memset fixMariusz Kozlowski2007-10-09
| | | | | | | Looks like memset() is zeroing wrong nr of bytes. Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5617): V4L2: videodev, allow debuggingJiri Slaby2007-05-09
| | | | | | | | videodev, allow debugging fix typo? in videodev.c to allow debugging Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5569): Fix: v4l1_compat should be called only if V4L1_COMPATMauro Carvalho Chehab2007-05-09
| | | | | | Added also some explanations about V4L1 handling Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5568): VIDIOCGMBUF handling in video_ioctl2()Sam Revitch2007-05-09
| | | | | | | Correct handling of VIDIOCGMBUF in video_ioctl2(). Signed-off-by: Sam Revitch <samr7@cs.washington.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* header cleaning: don't include smp_lock.h when not usedRandy Dunlap2007-05-08
| | | | | | | | | | | | Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* V4L/DVB (5554): Fix: vidioc_g_parm were not zeroing the memoryMauro Carvalho Chehab2007-04-27
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5306): Add support for VIDIOC_G_CHIP_IDENTHans Verkuil2007-04-27
| | | | | | | | | | | VIDIOC_G_CHIP_IDENT improves debugging of card problems: it can be used to detect which chips are on the board and based on that information selected register dumps can be made, making it easy to debug complicated media chips containing tens or hundreds of registers. This ioctl replaces the internal VIDIOC_INT_G_CHIP_IDENT ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5289): Add support for video output overlays.Hans Verkuil2007-04-27
| | | | | | | | | | Add V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY support. Also add support for local and global alpha overlays. Add new field enums V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT. These changes are needed to support the ivtv On Screen Display features. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5271): Add VIDIOC_TRY_ENCODER_CMD and VIDIOC_ENCODER_CMD ioctls.Hans Verkuil2007-03-01
| | | | | | | | Add support for starting, stopping, pausing and resuming an MPEG (or similar compressed stream) encoder. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5270): Add VIDIOC_G_ENC_INDEX ioctlHans Verkuil2007-03-01
| | | | | | | | The VIDIOC_G_ENC_INDEX ioctl can obtain the MPEG index from an MPEG encoder. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5163): Add checks for CAP_SYS_ADMIN to VIDIOC_DBG_G_REGISTERTrent Piepho2007-02-21
| | | | | | | | | | Before, root privileges were only needed to set hardware registers, not to read them. On some hardware, reading from the wrong place at the wrong time can hang the machine. So, to be consistent, root privileges are required to read registers on all hardware. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5146): Make VIDIOC_INT_[SG]_REGISTER ioctls no longer internal onlyTrent Piepho2007-02-21
| | | | | | | | | | | | | | | | | | | | | The direct register access ioctls were defined as kernel internal only, but they are very useful for debugging hardware from userspace and are used as such. Officially export them. VIDIOC_INT_[SG]_REGISTER is renamed to VIDIOC_DBG_[SG]_REGISTER Definition of ioctl and struct v4l2_register is moved from v4l2-common.h to videodev2.h. Types used in struct v4l2_register are changed to the userspace exportable versions (u32 -> __u32, etc). Use of VIDIOC_DBG_S_REGISTER requires CAP_SYS_ADMIN permission, so move the check into the video_ioctl2() dispatcher so it doesn't need to be duplicated in each driver's call-back function. CAP_SYS_ADMIN check is added to pvrusb2 (which doesn't use video_ioctl2). Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (5144): Restore VIDIOC_INT_[SG]_REGISTER callsTrent Piepho2007-02-21
| | | | | | | | Add support for these ioctls to the video_ioctl2 system and the cx88 driver. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* [PATCH] remove many unneeded #includes of sched.hTim Schmielau2007-02-14
| | | | | | | | | | | | | | | | | | | | | | | | After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] mark struct file_operations const 4Arjan van de Ven2007-02-12
| | | | | | | | | | | | Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. [akpm@sdl.org: dvb fix] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* V4L/DVB (4901): Improve debug msgs to show fourcc and buffer length on ↵Mauro Carvalho Chehab2006-12-10
| | | | | | video_ioctl2 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (4861): Remove the need of a STD array for drivers using video_ioctl2Mauro Carvalho Chehab2006-12-10
| | | | | | | | | | | video_ioctl2 will auto-generate standard entries at ENUM_FMT. Also, now, a driver may return a subset of the video array at the return, to be stored as the current_norm. For example, a driver may ask for V4L2_STD_PAL. At return, driver may change it to V4L2_STD_PAL_B. This way, a futher call to G_STD will return the exact detected video std. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (4860): Optimization of v4l1 handlingMauro Carvalho Chehab2006-12-10
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (4859): Fix initializations on some video_ioctl2 handlersMauro Carvalho Chehab2006-12-10
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* [PATCH] struct path: convert v4lJosef Sipek2006-12-08
| | | | | | Signed-off-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* V4L/DVB (4743): Fix oops in VIDIOC_G_PARMJonathan Corbet2006-10-13
| | | | | | | | | | The call to v4l2_std_construct() in the VIDIOC_G_PARM handler treats vfd->current_norm as if it were an index - but it's not. The result is an oops if the driver has no vidioc_g_parm() method defined. Here's the fix. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (4740): Fixed an if-block to avoid floating with debug-messagesEnrico Scholz2006-10-13
| | | | | | | | | | The dbgarg() macro in videodev.c contains some printk() statements where only the first one is influenced by an if-statement. This causes floating with debug-messages which is fixed by this patch by adding a '{ ... }' pair. Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>