aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-ctrls.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-08-24[media] v4l2-ctrl: Suppress build warning from v4l2_ctrl_new_std_menu()Sylwester Nawrocki1-1/+1
Prevent following build warning: drivers/media/v4l2-core/v4l2-ctrls.c: In function v4l2_ctrl_new_std_menu: drivers/media/v4l2-core/v4l2-ctrls.c:1768:15: warning: 'qmenu_int_len' may be used uninitialized in this function Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Cc: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] V4L: Add VP8 encoder controlsArun Kumar K1-2/+37
This patch adds new V4L controls for VP8 encoding. Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] V4L: Add support for integer menu controls with standard menu itemsSylwester Nawrocki1-3/+25
The patch modifies the helper function v4l2_ctrl_new_std_menu to accept integer menu controls with standard menu items. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-08[media] v4l2-ctrls: V4L2_CTRL_CLASS_FM_RX controls are also valid radio controlsHans Verkuil1-0/+2
The radio filter function that filters controls that are valid for a radio device should also accept V4L2_CTRL_CLASS_FM_RX controls. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-31[media] V4L: Add MATRIX option to V4L2_CID_EXPOSURE_METERING controlSylwester Nawrocki1-0/+1
This patch adds a menu option to the V4L2_CID_EXPOSURE_METERING control for multi-zone metering. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29[media] v4l2: Add standard controls for FM receiversAndrey Smirnov1-3/+11
This commit introduces new class of standard controls V4L2_CTRL_CLASS_FM_RX. This class is intended to all controls pertaining to FM receiver chips. Also, two controls belonging to said class are added as a part of this commit: V4L2_CID_TUNE_DEEMPHASIS and V4L2_CID_RDS_RECEPTION. This patch is based on the code found in the patch by Manjunatha Halli [1] [1] http://lists-archives.com/linux-kernel/27641307-new-control-class-and-features-for-fm-rx.html Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2-ctrls: add V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER controlHans Verkuil1-0/+2
Control whether video sequence headers should be repeated. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2-ctrls: eliminate lockdep false alarms for struct v4l2_ctrl_handler.lockAndy Walls1-3/+5
When calling v4l2_ctrl_add_handler(), lockdep would detect a potential recursive locking problem on a situation that is by design intended and not a recursive lock. This happened because all struct v4l2_ctrl_handler.lock mutexes were created as members of the same lock class in v4l2_ctrl_handler_init(), and v4l2_ctrl_add_handler() takes the hdl->lock on two different v4l2_ctrl_handler instances. This change breaks the large lockdep lock class for struct v4l2_ctrl_handler.lock and breaks it into v4l2_ctrl_handler instantiation specific lock classes with meaningful class names. This will validly eliminate lockdep alarms for v4l2_ctrl_handler locking validation, as long as the relationships between drivers adding v4l2 controls to their own handler from other v4l2 drivers' control handlers remains straightforward. struct v4l2_ctrl_handler.lock lock classes are created with names such that the output of cat /proc/lockdep indicates where in the v4l2 driver code v4l2_ctrl_handle_init() is being called on instantiations: ffffffffa045f490 FD: 10 BD: 8 +.+...: cx2341x:1534:(hdl)->lock ffffffffa0497d20 FD: 12 BD: 2 +.+.+.: saa7115:1581:(hdl)->lock ffffffffa04ac660 FD: 14 BD: 2 +.+.+.: msp3400_driver:756:(hdl)->lock ffffffffa0484b90 FD: 12 BD: 1 +.+.+.: ivtv_gpio:366:(&itv->hdl_gpio)->lock ffffffffa04eb530 FD: 11 BD: 2 +.+.+.: cx25840_core:1982:(&state->hdl)->lock ffffffffa04fbc80 FD: 11 BD: 3 +.+.+.: wm8775:246:(&state->hdl)->lock Some lock chains, that were previously causing the recursion alarms, are now visible in the output of cat /proc/lockdep_chains: irq_context: 0 [ffffffffa0497d20] saa7115:1581:(hdl)->lock [ffffffffa045f490] cx2341x:1534:(hdl)->lock irq_context: 0 [ffffffffa04ac660] msp3400_driver:756:(hdl)->lock [ffffffffa045f490] cx2341x:1534:(hdl)->lock irq_context: 0 [ffffffffa0484b90] ivtv_gpio:366:(&itv->hdl_gpio)->lock [ffffffffa045f490] cx2341x:1534:(hdl)->lock irq_context: 0 [ffffffffa04eb530] cx25840_core:1982:(&state->hdl)->lock [ffffffffa045f490] cx2341x:1534:(hdl)->lock irq_context: 0 [ffffffffa04fbc80] wm8775:246:(&state->hdl)->lock [ffffffffa045f490] cx2341x:1534:(hdl)->lock Signed-off-by: Andy Walls <awalls@md.metrocast.net> [hans.verkuil@cisco.com: keep mutex_init in v4l2_ctrl_handler_init_class] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05[media] V4L: Add v4l2_ctrl_subdev_log_status() helper functionSylwester Nawrocki1-0/+7
This patch adds a v4l2 core helper function that can be used as the log_status handler for subdevs that only need to log state of the v4l2 controls owned by the subdev's control handler. Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05[media] V4L: Add v4l2_ctrl_subdev_subscribe_event() helper functionSylwester Nawrocki1-0/+9
Add a v4l2 core helper function that can be used as the subdev .subscribe_event handler. This allows to eliminate some boilerplate from drivers that are only handling the control events. Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05[media] v4l2-ctrl: Add helper function for the controls range updateSylwester Nawrocki1-39/+104
This patch adds a helper function that allows to modify range, i.e. minimum, maximum, step and default value of a v4l2 control, after the control has been created and initialized. This is helpful in situations when range of a control depends on user configurable parameters, e.g. camera sensor absolute exposure time depending on an output image resolution and frame rate. v4l2_ctrl_modify_range() function allows to modify range of an INTEGER, BOOL, MENU, INTEGER_MENU and BITMASK type controls. Based on a patch from Hans Verkuil http://patchwork.linuxtv.org/patch/8654. Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-06[media] V4L: Remove deprecated image centering controlsSylwester Nawrocki1-2/+0
It has been over 3 years since the V4L2_CID_[HV]CENTER were deprecated. Clean up the DocBook and remove the V4L2_CID_VCENTER_DEPRECATED, V4L2_CID_VCENTER_DEPRECATED control related paragraphs. Remove the V4L2_CID_[HV]CENTER controls definitions from v4l2-controls.h, these controls are not used by any driver in the mainline now. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-05[media] v4l2-ctrls: add a notify callbackHans Verkuil1-0/+18
Sometimes platform/bridge drivers need to be notified when a control from a sub-device changes value. In order to support this a notify callback was added. [dheitmueller@kernellabs.com: fix merge conflict in v4l2-ctrls.c] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-05[media] v4l: Add control definitions for new H264 encoder featuresArun Kumar K1-0/+42
New controls are added for supporting H264 encoding features like: - MVC frame packing, - flexible macroblock ordering, - arbitrary slice ordering, - hierarchical coding. Signed-off-by: Jeongtae Park <jtp.park@samsung.com> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-05[media] media: v4l2-ctrl: add a helper function to add standard control with driver specific menuLad, Prabhakar1-0/+30
Add helper function v4l2_ctrl_new_std_menu_items(), which adds a standard menu control, with driver specific menu. Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-05[media] media: v4l2-ctrls: add control for test patternLad, Prabhakar1-0/+2
add V4L2_CID_TEST_PATTERN of type menu, which determines the internal test pattern selected by the device. Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01[media] v4l2-ctrls: add a filter function to v4l2_ctrl_add_handlerHans Verkuil1-1/+24
With a filter function you can control more precisely which controls are added. This is useful in particular for radio device nodes for combined TV/Radio cards where you want to show just the radio-specific controls and not controls like brightness. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] v4l2: make vidioc_(un)subscribe_event constHans Verkuil1-1/+1
Write-only ioctls should have a const argument in the ioctl op. Do this conversion for vidioc_(un)subscribe_event. Adding const for write-only ioctls was decided during the 2012 Media Workshop. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13[media] v4l2-ctrls: Add v4l2_ctrl_[gs]_ctrl_int64()Laurent Pinchart1-53/+82
These helper functions get and set a 64-bit control's value from within a driver. They are similar to v4l2_ctrl_[gs]_ctrl() but operate on 64-bit integer controls instead of 32-bit controls. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13[media] v4l2-ctrls.c: add support for the new DV controlsHans Verkuil1-0/+39
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13[media] v4l: move v4l2 core into a separate directoryMauro Carvalho Chehab1-0/+2651
Currently, the v4l2 core is mixed together with other non-core drivers. Move them into a separate directory. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>