Commit 6b623dbf authored by Luca Ceresoli's avatar Luca Ceresoli Committed by Mauro Carvalho Chehab

media: docs: v4l2-controls: add links to functions

This section lacks links to functions. Add one to simplify reading.
Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent e36160b8
...@@ -114,7 +114,7 @@ For sub-device drivers: ...@@ -114,7 +114,7 @@ For sub-device drivers:
2) Add controls: 2) Add controls:
You add non-menu controls by calling v4l2_ctrl_new_std: You add non-menu controls by calling :c:func:`v4l2_ctrl_new_std`:
.. code-block:: none .. code-block:: none
...@@ -122,7 +122,8 @@ You add non-menu controls by calling v4l2_ctrl_new_std: ...@@ -122,7 +122,8 @@ You add non-menu controls by calling v4l2_ctrl_new_std:
const struct v4l2_ctrl_ops *ops, const struct v4l2_ctrl_ops *ops,
u32 id, s32 min, s32 max, u32 step, s32 def); u32 id, s32 min, s32 max, u32 step, s32 def);
Menu and integer menu controls are added by calling v4l2_ctrl_new_std_menu: Menu and integer menu controls are added by calling
:c:func:`v4l2_ctrl_new_std_menu`:
.. code-block:: none .. code-block:: none
...@@ -131,7 +132,7 @@ Menu and integer menu controls are added by calling v4l2_ctrl_new_std_menu: ...@@ -131,7 +132,7 @@ Menu and integer menu controls are added by calling v4l2_ctrl_new_std_menu:
u32 id, s32 max, s32 skip_mask, s32 def); u32 id, s32 max, s32 skip_mask, s32 def);
Menu controls with a driver specific menu are added by calling Menu controls with a driver specific menu are added by calling
v4l2_ctrl_new_std_menu_items: :c:func:`v4l2_ctrl_new_std_menu_items`:
.. code-block:: none .. code-block:: none
...@@ -141,7 +142,7 @@ v4l2_ctrl_new_std_menu_items: ...@@ -141,7 +142,7 @@ v4l2_ctrl_new_std_menu_items:
s32 skip_mask, s32 def, const char * const *qmenu); s32 skip_mask, s32 def, const char * const *qmenu);
Integer menu controls with a driver specific menu can be added by calling Integer menu controls with a driver specific menu can be added by calling
v4l2_ctrl_new_int_menu: :c:func:`v4l2_ctrl_new_int_menu`:
.. code-block:: none .. code-block:: none
...@@ -149,7 +150,8 @@ v4l2_ctrl_new_int_menu: ...@@ -149,7 +150,8 @@ v4l2_ctrl_new_int_menu:
const struct v4l2_ctrl_ops *ops, const struct v4l2_ctrl_ops *ops,
u32 id, s32 max, s32 def, const s64 *qmenu_int); u32 id, s32 max, s32 def, const s64 *qmenu_int);
These functions are typically called right after the v4l2_ctrl_handler_init: These functions are typically called right after the
:c:func:`v4l2_ctrl_handler_init`:
.. code-block:: none .. code-block:: none
...@@ -188,33 +190,34 @@ These functions are typically called right after the v4l2_ctrl_handler_init: ...@@ -188,33 +190,34 @@ These functions are typically called right after the v4l2_ctrl_handler_init:
return err; return err;
} }
The v4l2_ctrl_new_std function returns the v4l2_ctrl pointer to the new The :c:func:`v4l2_ctrl_new_std` function returns the v4l2_ctrl pointer to
control, but if you do not need to access the pointer outside the control ops, the new control, but if you do not need to access the pointer outside the
then there is no need to store it. control ops, then there is no need to store it.
The v4l2_ctrl_new_std function will fill in most fields based on the control The :c:func:`v4l2_ctrl_new_std` function will fill in most fields based on
ID except for the min, max, step and default values. These are passed in the the control ID except for the min, max, step and default values. These are
last four arguments. These values are driver specific while control attributes passed in the last four arguments. These values are driver specific while
like type, name, flags are all global. The control's current value will be set control attributes like type, name, flags are all global. The control's
to the default value. current value will be set to the default value.
The v4l2_ctrl_new_std_menu function is very similar but it is used for menu The :c:func:`v4l2_ctrl_new_std_menu` function is very similar but it is
controls. There is no min argument since that is always 0 for menu controls, used for menu controls. There is no min argument since that is always 0 for
and instead of a step there is a skip_mask argument: if bit X is 1, then menu menu controls, and instead of a step there is a skip_mask argument: if bit
item X is skipped. X is 1, then menu item X is skipped.
The v4l2_ctrl_new_int_menu function creates a new standard integer menu The :c:func:`v4l2_ctrl_new_int_menu` function creates a new standard
control with driver-specific items in the menu. It differs from integer menu control with driver-specific items in the menu. It differs
v4l2_ctrl_new_std_menu in that it doesn't have the mask argument and takes from v4l2_ctrl_new_std_menu in that it doesn't have the mask argument and
as the last argument an array of signed 64-bit integers that form an exact takes as the last argument an array of signed 64-bit integers that form an
menu item list. exact menu item list.
The v4l2_ctrl_new_std_menu_items function is very similar to The :c:func:`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 v4l2_ctrl_new_std_menu but takes an extra parameter qmenu, which is the
specific menu for an otherwise standard menu control. A good example for this driver specific menu for an otherwise standard menu control. A good example
control is the test pattern control for capture/display/sensors devices that for this control is the test pattern control for capture/display/sensors
have the capability to generate test patterns. These test patterns are hardware devices that have the capability to generate test patterns. These test
specific, so the contents of the menu will vary from device to device. 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 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 ctrl_handler->error to the error code. If ctrl_handler->error was already
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment