summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/v4l2-common.c
AgeCommit message (Collapse)Author
2009-08-11v4l2: video device: Add FM TX controls default configurationsMauro Carvalho Chehab
From: Eduardo Valentin <eduardo.valentin@nokia.com> This patch adds basic configurations for FM TX extended controls. That includes controls names, menu strings, pointer identification, type classification and flags configuration. Priority: normal Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-11v4l: introduce string control support.Mauro Carvalho Chehab
From: Hans Verkuil <hverkuil@xs4all.nl> The upcoming RDS encoder needs support for string controls. This patch implements the core implementation. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-10v4l: simplify v4l2_i2c_new_subdev and friendsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Rewrite v4l2_i2c_new_subdev as a simplified version of v4l2_i2c_new_subdev_cfg and remove v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr. This simplifies this API substantially. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-06-26v4l2-common: fix uninitialized variableHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Fix compiler warning for uninitialized variable when compiling for pre 2.6.26 kernels. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-06-23merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-subdev2Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16v4l2: Fix flaw in alignment codeTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> It's possible that the height alignment would be increased beyond the maximum possible value when trying to satisfy size alignment. Please fold with b4d3ec8d363d v4l2: Create helper function for bounding and aligning images Priority: high Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2009-06-12v4l2: Move bounding code outside I2C ifdef blockMauro Carvalho Chehab
From: Trent Piepho <xyzzy@speakeasy.org> On Fri, 12 Jun 2009, Randy Dunlap wrote: > From: Randy Dunlap <randy.dunlap@oracle.com> > > Move v4l_bound_align_image() outside of an #ifdef CONFIG_I2C block > so that it is always built. Fixes a build error: clamp_align() should be moved as well, since it's only used by v4l_bound_align_image(). I'm attaching an alternate version that fixes this. Labeled the endif too. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-09v4l2: add new s_config subdev ops and v4l2_i2c_new_subdev_cfg/board callsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add a new s_config core ops call: this is called with the irq and platform data to be used to initialize the subdev. Added new v4l2_i2c_new_subdev_cfg and v4l2_i2c_new_subdev_board calls that allows you to pass these new arguments. The existing v4l2_i2c_new_subdev functions were modified to also call s_config. In the future the existing v4l2_i2c_new_subdev functions will be replaced by a single v4l2_i2c_new_subdev function similar to v4l2_i2c_new_subdev_cfg but without the irq and platform_data arguments. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-05-30v4l2: Create helper function for bounding and aligning imagesTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Most hardware has limits on minimum and maximum image dimensions and also requirements about alignment. For example, image width must be even or a multiple of four. Some hardware has requirements that the total image size (width * height) be a multiple of some power of two. v4l_bound_align_image() will enforce min and max width and height, power of two alignment on width and height, and power of two alignment on total image size. It uses an efficient algorithm that will try to find the "closest" image size that meets the requirements. Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2009-05-02v4l2-device: unregister i2c_clients when unregistering the v4l2_device.Mauro Carvalho Chehab
From: Hans Verkuil <hverkuil@xs4all.nl> Until now I relied on i2c_del_adapter to unregister the i2c_clients for me, however, if the i2c bus is a platform bus then it is never deleted. So instead I need to unregister i2c clients when unregistering the v4l2_device. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-02tuner: remove tuner_i2c_address_checkMauro Carvalho Chehab
From: Hans Verkuil <hverkuil@xs4all.nl> Support for tuners with i2c addresses >= 0x65 is dropped since no tuners with addresses in the range 0x65-0x6f have been found. This patch removes addresses 0x65-0x6f from the list of tuner probe addresses, it removes the kernel warning that warned if addresses in this range appeared, and it removed a hack for the cx88 that is no longer needed now that the tuner address range is reduced. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30v4l2-common: add v4l2_i2c_new_probed_subdev_addrHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add utility function to probe for a single address, rather than a list of addresses. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-04-01v4l2-common: add explicit v4l2_device pointer as first arg to ↵Hans Verkuil
new_(probed)_subdev From: Hans Verkuil <hverkuil@xs4all.nl> The functions v4l2_i2c_new_subdev and v4l2_i2c_new_probed_subdev relied on i2c_get_adapdata to return the v4l2_device. However, this is not always possible on embedded platforms. So modify the API to pass the v4l2_device pointer explicitly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30v4l2: use old-style i2c API for kernels < 2.6.26 instead of < 2.6.22Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Originally the intention was to switch to the new style i2c API starting with the introduction of the API in 2.6.22. However, the i2c_new_probed_device() function has a lethal bug that wasn't fixed until 2.6.25. Or more accurately, it was only fixed in the stable series of 2.6.25 and 2.6.26. Given the fact that the new i2c API also changed starting with 2.6.26 (the addition of i2c_device_id), it is easiest to switch APIs starting with 2.6.26. This patch updates all the legacy code accordingly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-04-01v4l2-common: remove legacy codeHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Now that all drivers are converted to v4l2_subdev we can remove legacy code in v4l2-common. Also move the documentation of the internal API to v4l2-subdev.h where it really belongs. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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>