summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/v4l2-common.c
AgeCommit message (Collapse)Author
2009-03-19merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvbMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-18adds V4L2_CID_SHARPNESS to v4l2_ctrl_query_fill()Janne Grunau
From: Janne Grunau <j@jannau.net> Priority: normal Signed-off-by: Janne Grunau <j@jannau.net>
2009-03-18v4l2-common: remove incorrect MODULE testHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> v4l2-common doesn't have to be a module for it to call request_module(). Just remove that test. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Thanks-to: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2009-03-12v4l2-common: add missing i2c_unregister_device.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> If the i2c sub-device cannot be found, then we must unregister the i2c_client. Otherwise this will prevent a possible probe for a different device on that same address. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-02-26v4l2-common: Fix a merge conflict bad solvedMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-26merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-fill-stdMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-26merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-usbvisionMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-21v4l2-common: remove v4l2_ctrl_query_fill_stdHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The v4l2_ctrl_query_fill_std() function wasn't one the best idea I ever had. It doesn't add anything valuable that cannot be expressed equally well with v4l2_ctrl_query_fill and only adds overhead. Replace it with v4l2_ctrl_query_fill() everywhere it is used and remove it from v4l2_common.c. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-02-21v4l2-common: add v4l2_i2c_subdev_addr()Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add small function to retrieve the i2c address from a v4l2_subdev pointer. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-02-20v4l2-common/v4l2-spec: support/document write-only and button controlsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The controls V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET changed their type to button controls (these are unused at the moment, so this is a safe change). The controls V4L2_CID_PAN_RELATIVE, V4L2_CID_TILT_RELATIVE, V4L2_CID_FOCUS_RELATIVE and V4L2_CID_ZOOM_RELATIVE are marked as write-only controls. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: Laurent Pinchart <laurent.pinchart@skynet.be>
2009-02-20v4l2: add colorfx support to v4l2-common.c, and add to 'Changes' in spec.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-02-13v4l2-common: add comments warning that about the sort orderHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Control arrays as are used with v4l2_ctrl_next must be sorted from low to high. Add a comment at the top of all such arrays to warn about this. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-18v4l2-common: added v4l2_i2c_tuner_addrs()Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add v4l2_i2c_tuner_addrs() to obtain the various I2C tuner addresses. This will be used in several drivers, so make this a common function as we do not want to have these I2C addresses all over the place. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-17v4l2: replace a few snprintfs with strlcpyHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-12-30v4l2: debugging API changed to match against driver name instead of ID.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-12-14v4l2: Add missing control namesLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Update v4l2_ctrl_get_name() and v4l2_ctrl_get_menu() with missing control names and menu values. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-11-23v4l2-common: add i2c helper functionsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add helper functions to load i2c sub-devices, integrating them into the v4l2-framework. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-27rationalise addresses to one common oneMauro Carvalho Chehab
From: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21backport commit a65e5d782f9db2a61a914dc01a329e0c2dcf92a1Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Johannes Berg <johannes@sipsolutions.net> remove CONFIG_KMOD from drivers Straight forward conversions to CONFIG_MODULE; many drivers include <linux/kmod.h> conditionally and then don't have any other conditional code so remove it from those. kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-08-09v4l2: add AAC bitrate controlHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> If you can select AAC as audio encoder, then you should also be able to set the bitrate. Add this missing control. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-08saa6752hs: cleanup and add AC-3 supportHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Cleaned up the saa6752hs i2c driver. Add AC-3 support. Add VIDIOC_CHIP_IDENT support. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-08v4l2: add v4l2_ctrl_query_menu_valid_items support functionHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> v4l2_ctrl_query_menu_valid_items() makes it easy to handle control menus that have a lot of invalid 'holes'. For example, many MPEG encoders only support a limited subset of audio bitrates. In that case a driver can specify an array listing the set of valid bitrates and pass that to this function. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-08v4l2: add v4l2_ctrl_get_name control support function.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add function that returns the control name. Allows this to be used in places where the normal v4l2_ctrl_query_fill() function cannot be used (e.g. uvc). Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-08v4l: add AC-3 audio support to the MPEG Encoding APIHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Some models of the saa6752hs support AC-3. Extend the API with the necessary controls for AC-3. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-08v4l2: extend MPEG Encoding API with AVC and AACHans Verkuil
From: Janne Grunau <j@jannau.net> Adds Advanced Audio Coding (AAC) and MPEG-4 Advanced Video Coding (AVC/H.264) as audio/video codecs to the extended controls API. Updates cx2341x driver to the new values. Priority: normal Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-25videodev: replace videodev.h includes by videodev2.h where possibleHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Several V4L2 drivers still included videodev.h. Fix this. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.16Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 4 removes the compatibility support for kernels < 2.6.16. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.0Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> First phase of the backwards compatibility cleanup: stop supporting kernels older than 2.6.0. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-05-02backport commit a6a3a17b7fdaf824e6d73e8e4a94c9d149302f74Mauro Carvalho Chehab
kernel-sync: Author: Harvey Harrison <harvey.harrison@gmail.com> Date: Mon Apr 28 16:50:03 2008 -0700 media: fix integer as NULL pointer warnings drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer drivers/media/video/videobuf-core.c:100:9: warning: Using plain integer as NULL pointer Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-02backport commit d2653e92732bd3911feff6bee5e23dbf959381dbMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Author: Jean Delvare <khali@linux-fr.org> Date: Tue Apr 29 23:11:39 2008 +0200 i2c: Add support for device alias names Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-02Fix Kconfig dependenciesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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>
2008-01-31Remove obsolete code from v4l2-commonMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-29Fix bug #9833: regression when compiling V4L without I2CMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Adrian Bunk reported: > > Commit 8ffbc6559493c64d6194c92d856196fdaeb8a5fb causes the following > > compile error with CONFIG_VIDEO_DEV=y/m, CONFIG_I2C=n: > > > > <-- snip --> > > > > ... > > MODPOST 26 modules > > ERROR: "i2c_attach_client" [drivers/media/video/v4l2-common.ko] undefined! > > make[2]: *** [__modpost] Error 1 > > > > <-- snip --> ... And what should happen if CONFIG_VIDEO_DEV=y, CONFIG_I2C=m? CC: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-28Partially revert changeset 7097:ed7daeb29425Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> An experimental, incomplete changeset were committed by mistake. Reverting it. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-28saa7134-dvb: add missing dvb_attach call (for tda10046_attach)Mauro Carvalho Chehab
From: Matthias Schwarzott <zzam@gentoo.org> saa7134-dvb: add missing dvb_attach around tda10046_attach This patch adds a possibly missing dvb_attach for tda10046_attach. This removes the hard dependency of saa7134-dvb on tda1004x module. Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-02backport changeset 96de0e252cedffad61b3cb5e05662c591898e69aMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Author: Jan Engelhardt <jengelh@gmx.de> Date: Fri Oct 19 23:21:04 2007 +0200 Convert files to UTF-8 and some cleanups * Convert files to UTF-8. * Also correct some people's names (one example is Eißfeldt, which was found in a source file. Given that the author used an ß at all in a source file indicates that the real name has in fact a 'ß' and not an 'ss', which is commonly used as a substitute for 'ß' when limited to 7bit.) * Correct town names (Goettingen -> Göttingen) * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313) Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-18v4l2-common: minor cleanups.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/v4l2-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
2007-09-16Use correct error codes when chip is not recognized.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> If the chip isn't recognized, then the correct errors should be returned. The v4l2_i2c_attach() utility function will return 0 for all errors except -ENOMEM to provide proper compatibility support for the old I2C probing function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/cs53l32a.c | 2 +- linux/drivers/media/video/cx25840/cx25840-core.c | 6 +++++- linux/drivers/media/video/msp3400-driver.c | 4 ++-- linux/drivers/media/video/saa7115.c | 4 ++-- linux/drivers/media/video/saa7127.c | 6 +++--- linux/drivers/media/video/tlv320aic23b.c | 2 +- linux/drivers/media/video/upd64031a.c | 2 +- linux/drivers/media/video/upd64083.c | 2 +- linux/drivers/media/video/v4l2-common.c | 2 +- linux/drivers/media/video/vp27smpx.c | 2 +- linux/drivers/media/video/wm8739.c | 4 ++++ 11 files changed, 22 insertions(+), 14 deletions(-)
2007-09-12v4l2: add support for bus-based I2C driversHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Two new headers were added: one for I2C drivers that are only used by V4L2 drivers converted to the new bus-based I2C API, and one that can be used by both converted and unconverted drivers (at the expense of some additional overhead). To support the legacy I2C API a helper function was added to v4l2-common.c. These headers take care of all the 'boilerplate' code that all V4L2 I2C drivers have in common and will automatically support the bus-based I2C API introduced in kernel 2.6.22. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/v4l2-common.c | 37 +++++ linux/include/media/v4l2-common.h | 11 + linux/include/media/v4l2-i2c-drv-legacy.h | 207 ++++++++++++++++++++++++++++++ linux/include/media/v4l2-i2c-drv.h | 199 ++++++++++++++++++++++++++++ 4 files changed, 454 insertions(+)
2007-10-18Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIGMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Currently, the only tuner-specific device that allows special configurations is tda9887. However, tea5767 also may require some special configurations (for example, to specify a different Xtal freq). This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl (TUNER_SET_CONFIG). The newer one allows specifying what tuner is appliable to a configuration set, and allows an arbitrary configuration struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-11Remove obsolete VIDIOC_S/G_MPEGCOMP ioctlsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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>
2007-10-08Remove reference to dead CONFIG_UST and ust.h header.Mauro Carvalho Chehab
From: "Robert P. J. Day" <rpjday@mindspring.com> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-08compat: remove strlcpyMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> This is already defined on compat.h Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-21cx2341x: some controls should not be changed while the device is busy.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The driver should now pass the 'busy' state of the device to the cx2341x module whenever controls are set or tried. -EBUSY will be returned if the device is busy and the user attempts to modify certain 'dangerous' controls. It concerns controls that change the audio or video compression mode and bitrates. The cx88-blackbird and pvrusb2 drivers currently always pass '0' (not busy) to the cx2341x, effectively keeping the old behavior for now. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-07-19Add check for valid control ID to v4l2_ctrl_next.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> If v4l2_ctrl_next is called without the V4L2_CTRL_FLAG_NEXT_CTRL then it should check whether the passed control ID is valid and return 0 if it isn't. Otherwise a for-loop over the control IDs will never end. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-07-05v4l2: Update v4l_printk_ioctl_argTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> v4l_printk_ioctl_arg() is a debug printing function that is normally disabled. It was out of date with one ioctl and had a couple bugs in it elsewhere. This patch gets it in a state where it will work correctly, if it was enabled and used. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-05-13Backport kernel changeset e63340ae6b6205fef26b40a75673d1c9c0c8bb90Mauro Carvalho Chehab
From: Mauro Carvalho Chehab kernel-sync: The original patch description, from Randy Dunlap <randy.dunlap@oracle.com>: header cleaning: don't include smp_lock.h when not used 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: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-27Improve VIDIOC_G_CHIP_IDENT (better diagnostics)Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Simplify the VIDIOC_G_CHIP_IDENT implementation by adding a single common function. The ident can now also return NONE: not found, UNKNOWN: found, but we don't know what chip it is, and AMBIGUOUS: multiple chips were matched so the match values were too general. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-02-25Remove V4L2_CHIP_MATCH_ALWAYS.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> V4L2_CHIP_MATCH_ALWAYS turned out to be confusing and also unnecessary. It's now removed. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-02-24Add support for VIDIOC_G_CHIP_IDENTHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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> CC: Jonathan Corbet <corbet@lwn.net>