summaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux/v4l2-controls.txt
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-12 12:39:17 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-12 12:39:17 +0900
commit4f1cd91497774488ed16119ec3f54b3daf1561de (patch)
tree190ed2b2ecbbfe371740cf6e29d9aefd25ecc3e3 /Documentation/video4linux/v4l2-controls.txt
parent759e00b8a8883be28357426206d2f1752827e38a (diff)
parentbf3b202b41999f88f091632f13842b7234bd58b7 (diff)
downloadlinux-4f1cd91497774488ed16119ec3f54b3daf1561de.tar.gz
linux-4f1cd91497774488ed16119ec3f54b3daf1561de.tar.xz
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull second set of media updates from Mauro Carvalho Chehab: "Despite its size, most of the stuff here is trivial. This series contains: - s5p-mfc: additions at the driver and at the core to support H.264 hardware codec; - Some improvements at s5p and davinci embedded drivers; - Some V4L2 compliance fixes applied on a few drivers; - Several random trivial patches, including several fixes and a few new board support additions; Notes: 1) Some Exynos media patches were dependent on some -arm fixes that got merged on changeset 782cd9e. That's why this pull request is based that changeset. 2) As promised, I reviewed the pending VB2 DMABUF series. While setting a test environment, it was noticed that the upstream support for Samsung Exynos 4 boards (smdk310 and Origen) are broken upstream, likely due to regressions: both defconfigs are wrong and regulator settings for both boards are broken. That, allied with some bug at the dummy regulator driver, causes OOPSes during boot time. Long story short: even fixing the above, the proposed patches OOPSed when running the DMABUF test. Not sure yet if the OOPSes are due to some other undetected regressions, or due to some bug on the patches. Due to the above, DMABUF patches for vb2 got NACKed for 3.7." * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (109 commits) [media] m5mols: Add missing #include <linux/sizes.h> [media] stk1160: Add support for S-Video input Revert "[media] omap3isp: Replace cpu_is_omap3630() with ISP revision check" [media] dvb: LNA implementation changes [media] v4l2-ioctl: fix W=1 warnings [media] v4l2-ioctl: add blocks check for VIDIOC_SUBDEV_G/S_EDID [media] omap3isp: Fix compilation error in ispreg.h [media] rc-msi-digivox-ii: Add full scan keycodes [media] cx25821: testing the wrong variable [media] tda18271-common: hold the I2C adapter during write transfers [media] ds3000: add module parameter to force firmware upload [media] drivers/media: Remove unnecessary semicolon [media] winbond: remove space from driver name [media] iguanair: cannot send data from the stack [media] omap3isp: Replace cpu_is_omap3630() with ISP revision check [media] dvb-usb: print small buffers via %*ph [media] uvc: Add return code check at vb2_queue_init() [media] em28xx: Replace memcpy with struct assignment [media] bt8xx: Add video4linux control V4L2_CID_COLOR_KILLER [media] mem2mem_testdev: Use devm_kzalloc() in probe ... Conflicts: arch/arm/mach-davinci/include/mach/da8xx.h
Diffstat (limited to 'Documentation/video4linux/v4l2-controls.txt')
-rw-r--r--Documentation/video4linux/v4l2-controls.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt
index 54270df99d5c..cfe52c798d74 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/video4linux/v4l2-controls.txt
@@ -136,11 +136,25 @@ Or alternatively for integer menu controls, by calling v4l2_ctrl_new_int_menu:
const struct v4l2_ctrl_ops *ops,
u32 id, s32 max, s32 def, const s64 *qmenu_int);
+Standard menu controls with a driver specific menu are added by calling
+v4l2_ctrl_new_std_menu_items:
+
+ struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(
+ struct v4l2_ctrl_handler *hdl,
+ const struct v4l2_ctrl_ops *ops, u32 id, s32 max,
+ s32 skip_mask, s32 def, const char * const *qmenu);
+
These functions are typically called right after the v4l2_ctrl_handler_init:
static const s64 exp_bias_qmenu[] = {
-2, -1, 0, 1, 2
};
+ static const char * const test_pattern[] = {
+ "Disabled",
+ "Vertical Bars",
+ "Solid Black",
+ "Solid White",
+ };
v4l2_ctrl_handler_init(&foo->ctrl_handler, nr_of_controls);
v4l2_ctrl_new_std(&foo->ctrl_handler, &foo_ctrl_ops,
@@ -156,6 +170,9 @@ These functions are typically called right after the v4l2_ctrl_handler_init:
ARRAY_SIZE(exp_bias_qmenu) - 1,
ARRAY_SIZE(exp_bias_qmenu) / 2 - 1,
exp_bias_qmenu);
+ v4l2_ctrl_new_std_menu_items(&foo->ctrl_handler, &foo_ctrl_ops,
+ V4L2_CID_TEST_PATTERN, ARRAY_SIZE(test_pattern) - 1, 0,
+ 0, test_pattern);
...
if (foo->ctrl_handler.error) {
int err = foo->ctrl_handler.error;
@@ -185,6 +202,13 @@ v4l2_ctrl_new_std_menu in that it doesn't have the mask argument and takes
as the last argument an array of signed 64-bit integers that form an exact
menu item list.
+The v4l2_ctrl_new_std_menu_items function is very similar to
+v4l2_ctrl_new_std_menu but takes an extra parameter qmenu, which is the driver
+specific menu for an otherwise standard menu control. A good example for this
+control is the test pattern control for capture/display/sensors devices that
+have the capability to generate test patterns. These test patterns are hardware
+specific, so the contents of the menu will vary from device to device.
+
Note that if something fails, the function will return NULL or an error and
set ctrl_handler->error to the error code. If ctrl_handler->error was already
set, then it will just return and do nothing. This is also true for