aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-04-16 08:41:25 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 08:18:09 -0400
commit0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3 (patch)
treedd9f045fa482ee601cdf4ee67c649530f22abc5e /include/media
parent7d6bc608e062f6b6667c9eeeb17055f017ecadb1 (diff)
[media] v4l2-ctrls: increase internal min/max/step/def to 64 bit
While VIDIOC_QUERYCTRL is limited to 32 bit min/max/step/def values for controls, the upcoming VIDIOC_QUERY_EXT_CTRL isn't. So increase the internal representation to 64 bits in preparation. Because of these changes the msi3101 driver has been modified slightly to fix a formatting issue (%d becomes %lld), vivi had to be modified as well to cope with the new 64-bit min/max values and the PIXEL_RATE control in a few sensor drivers required proper min/max/def values. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-ctrls.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 16f7f2606516..a2e8f038a8ed 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -131,10 +131,10 @@ struct v4l2_ctrl {
131 u32 id; 131 u32 id;
132 const char *name; 132 const char *name;
133 enum v4l2_ctrl_type type; 133 enum v4l2_ctrl_type type;
134 s32 minimum, maximum, default_value; 134 s64 minimum, maximum, default_value;
135 union { 135 union {
136 u32 step; 136 u64 step;
137 u32 menu_skip_mask; 137 u64 menu_skip_mask;
138 }; 138 };
139 union { 139 union {
140 const char * const *qmenu; 140 const char * const *qmenu;
@@ -216,9 +216,9 @@ struct v4l2_ctrl_handler {
216 * @menu_skip_mask: The control's skip mask for menu controls. This makes it 216 * @menu_skip_mask: The control's skip mask for menu controls. This makes it
217 * easy to skip menu items that are not valid. If bit X is set, 217 * easy to skip menu items that are not valid. If bit X is set,
218 * then menu item X is skipped. Of course, this only works for 218 * then menu item X is skipped. Of course, this only works for
219 * menus with <= 32 menu items. There are no menus that come 219 * menus with <= 64 menu items. There are no menus that come
220 * close to that number, so this is OK. Should we ever need more, 220 * close to that number, so this is OK. Should we ever need more,
221 * then this will have to be extended to a u64 or a bit array. 221 * then this will have to be extended to a bit array.
222 * @qmenu: A const char * array for all menu items. Array entries that are 222 * @qmenu: A const char * array for all menu items. Array entries that are
223 * empty strings ("") correspond to non-existing menu items (this 223 * empty strings ("") correspond to non-existing menu items (this
224 * is in addition to the menu_skip_mask above). The last entry 224 * is in addition to the menu_skip_mask above). The last entry
@@ -231,12 +231,12 @@ struct v4l2_ctrl_config {
231 u32 id; 231 u32 id;
232 const char *name; 232 const char *name;
233 enum v4l2_ctrl_type type; 233 enum v4l2_ctrl_type type;
234 s32 min; 234 s64 min;
235 s32 max; 235 s64 max;
236 u32 step; 236 u64 step;
237 s32 def; 237 s64 def;
238 u32 flags; 238 u32 flags;
239 u32 menu_skip_mask; 239 u64 menu_skip_mask;
240 const char * const *qmenu; 240 const char * const *qmenu;
241 const s64 *qmenu_int; 241 const s64 *qmenu_int;
242 unsigned int is_private:1; 242 unsigned int is_private:1;
@@ -257,7 +257,7 @@ struct v4l2_ctrl_config {
257 * control framework this function will no longer be exported. 257 * control framework this function will no longer be exported.
258 */ 258 */
259void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, 259void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
260 s32 *min, s32 *max, s32 *step, s32 *def, u32 *flags); 260 s64 *min, s64 *max, u64 *step, s64 *def, u32 *flags);
261 261
262 262
263/** v4l2_ctrl_handler_init_class() - Initialize the control handler. 263/** v4l2_ctrl_handler_init_class() - Initialize the control handler.
@@ -362,7 +362,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
362 */ 362 */
363struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, 363struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
364 const struct v4l2_ctrl_ops *ops, 364 const struct v4l2_ctrl_ops *ops,
365 u32 id, s32 min, s32 max, u32 step, s32 def); 365 u32 id, s64 min, s64 max, u64 step, s64 def);
366 366
367/** v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2 menu control. 367/** v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2 menu control.
368 * @hdl: The control handler. 368 * @hdl: The control handler.
@@ -372,9 +372,9 @@ struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
372 * @mask: The control's skip mask for menu controls. This makes it 372 * @mask: The control's skip mask for menu controls. This makes it
373 * easy to skip menu items that are not valid. If bit X is set, 373 * easy to skip menu items that are not valid. If bit X is set,
374 * then menu item X is skipped. Of course, this only works for 374 * then menu item X is skipped. Of course, this only works for
375 * menus with <= 32 menu items. There are no menus that come 375 * menus with <= 64 menu items. There are no menus that come
376 * close to that number, so this is OK. Should we ever need more, 376 * close to that number, so this is OK. Should we ever need more,
377 * then this will have to be extended to a u64 or a bit array. 377 * then this will have to be extended to a bit array.
378 * @def: The control's default value. 378 * @def: The control's default value.
379 * 379 *
380 * Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value 380 * Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value
@@ -384,7 +384,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
384 */ 384 */
385struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, 385struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
386 const struct v4l2_ctrl_ops *ops, 386 const struct v4l2_ctrl_ops *ops,
387 u32 id, s32 max, s32 mask, s32 def); 387 u32 id, u8 max, u64 mask, u8 def);
388 388
389/** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control 389/** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control
390 * with driver specific menu. 390 * with driver specific menu.
@@ -395,9 +395,9 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
395 * @mask: The control's skip mask for menu controls. This makes it 395 * @mask: The control's skip mask for menu controls. This makes it
396 * easy to skip menu items that are not valid. If bit X is set, 396 * easy to skip menu items that are not valid. If bit X is set,
397 * then menu item X is skipped. Of course, this only works for 397 * then menu item X is skipped. Of course, this only works for
398 * menus with <= 32 menu items. There are no menus that come 398 * menus with <= 64 menu items. There are no menus that come
399 * close to that number, so this is OK. Should we ever need more, 399 * close to that number, so this is OK. Should we ever need more,
400 * then this will have to be extended to a u64 or a bit array. 400 * then this will have to be extended to a bit array.
401 * @def: The control's default value. 401 * @def: The control's default value.
402 * @qmenu: The new menu. 402 * @qmenu: The new menu.
403 * 403 *
@@ -406,8 +406,8 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
406 * 406 *
407 */ 407 */
408struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl, 408struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
409 const struct v4l2_ctrl_ops *ops, u32 id, s32 max, 409 const struct v4l2_ctrl_ops *ops, u32 id, u8 max,
410 s32 mask, s32 def, const char * const *qmenu); 410 u64 mask, u8 def, const char * const *qmenu);
411 411
412/** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. 412/** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control.
413 * @hdl: The control handler. 413 * @hdl: The control handler.
@@ -424,7 +424,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
424 */ 424 */
425struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, 425struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl,
426 const struct v4l2_ctrl_ops *ops, 426 const struct v4l2_ctrl_ops *ops,
427 u32 id, s32 max, s32 def, const s64 *qmenu_int); 427 u32 id, u8 max, u8 def, const s64 *qmenu_int);
428 428
429/** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. 429/** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler.
430 * @hdl: The control handler. 430 * @hdl: The control handler.
@@ -560,7 +560,7 @@ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
560 * take the lock itself. 560 * take the lock itself.
561 */ 561 */
562int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, 562int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
563 s32 min, s32 max, u32 step, s32 def); 563 s64 min, s64 max, u64 step, s64 def);
564 564
565/** v4l2_ctrl_lock() - Helper function to lock the handler 565/** v4l2_ctrl_lock() - Helper function to lock the handler
566 * associated with the control. 566 * associated with the control.