diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-05-06 14:30:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 13:03:21 -0400 |
commit | 515f32879a05bdb69f9b3f86f53db4c04b95e845 (patch) | |
tree | 9a090c658d1dc1c96286cb9359cbfd13b42f5db3 /include/media/v4l2-ctrls.h | |
parent | 6491d1adfbf0e2ffbdfcda8cef60edc01b6700b3 (diff) |
[media] V4L: Add helper function for standard integer menu controls
This patch adds v4l2_ctrl_new_int_menu() helper function which can be used
in drivers for creating standard integer menu control with driver-specific
menu item list. It is similar to v4l2_ctrl_new_std_menu(), except it doesn't
have a mask parameter and an additional qmenu parameter allows passing
an array of signed 64-bit integers as the menu item list.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/v4l2-ctrls.h')
-rw-r--r-- | include/media/v4l2-ctrls.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 5edd64daa425..776605f1cbe2 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -351,6 +351,23 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, | |||
351 | const struct v4l2_ctrl_ops *ops, | 351 | const struct v4l2_ctrl_ops *ops, |
352 | u32 id, s32 max, s32 mask, s32 def); | 352 | u32 id, s32 max, s32 mask, s32 def); |
353 | 353 | ||
354 | /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. | ||
355 | * @hdl: The control handler. | ||
356 | * @ops: The control ops. | ||
357 | * @id: The control ID. | ||
358 | * @max: The control's maximum value. | ||
359 | * @def: The control's default value. | ||
360 | * @qmenu_int: The control's menu entries. | ||
361 | * | ||
362 | * Same as v4l2_ctrl_new_std_menu(), but @mask is set to 0 and it additionaly | ||
363 | * takes as an argument an array of integers determining the menu items. | ||
364 | * | ||
365 | * If @id refers to a non-integer-menu control, then this function will return NULL. | ||
366 | */ | ||
367 | struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, | ||
368 | const struct v4l2_ctrl_ops *ops, | ||
369 | u32 id, s32 max, s32 def, const s64 *qmenu_int); | ||
370 | |||
354 | /** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. | 371 | /** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. |
355 | * @hdl: The control handler. | 372 | * @hdl: The control handler. |
356 | * @ctrl: The control to add. | 373 | * @ctrl: The control to add. |