Lines Matching +full:control +full:- +full:parent

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
14 #include <media/media-request.h>
17 * Include the stateless codec compound control definitions.
20 #include <media/mpeg2-ctrls.h>
21 #include <media/fwht-ctrls.h>
22 #include <media/h264-ctrls.h>
23 #include <media/vp8-ctrls.h>
24 #include <media/hevc-ctrls.h>
39 * union v4l2_ctrl_ptr - A pointer to a control value.
40 * @p_s32: Pointer to a 32-bit signed value.
41 * @p_s64: Pointer to a 64-bit signed value.
42 * @p_u8: Pointer to a 8-bit unsigned value.
43 * @p_u16: Pointer to a 16-bit unsigned value.
44 * @p_u32: Pointer to a 32-bit unsigned value.
89 * v4l2_ctrl_ptr_create() - Helper function to return a v4l2_ctrl_ptr from a
101 * struct v4l2_ctrl_ops - The control operations that the driver has to provide.
103 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant
104 * for volatile (and usually read-only) controls such as a control
108 * @try_ctrl: Test whether the control's value is valid. Only relevant when
110 * @s_ctrl: Actually set the new control value. s_ctrl is compulsory. The
111 * ctrl->handler->lock is held when these ops are called, so no
121 * struct v4l2_ctrl_type_ops - The control type operations that the driver
142 * typedef v4l2_ctrl_notify_fnc - typedef for a notify argument with a function
143 * that should be called when a control value has changed.
146 * @priv: control private data
154 * struct v4l2_ctrl - The control structure.
157 * @ev_subs: The list of control event subscriptions.
158 * @handler: The handler that owns the control.
161 * @done: Internal flag: set for each processed control.
162 * @is_new: Set when the user specified a new value for this control. It
167 * @is_private: If set, then this control is private to its handler and it
170 * @is_auto: If set, then this control selects whether the other cluster
174 * @is_int: If set, then this control has a simple integer value (i.e. it
175 * uses ctrl->val).
176 * @is_string: If set, then this control has type %V4L2_CTRL_TYPE_STRING.
177 * @is_ptr: If set, then this control is an array and/or has type >=
181 * @is_array: If set, then this control contains an N-dimensional array.
185 * control's value changes.
187 * of the auto control that determines if that control is in
188 * manual mode. So if the value of the auto control equals this
191 * @ops: The control ops.
192 * @type_ops: The control type ops.
193 * @id: The control ID.
194 * @name: The control name.
195 * @type: The control type.
196 * @minimum: The control's minimum value.
197 * @maximum: The control's maximum value.
198 * @default_value: The control's default value.
199 * @step: The control's step value for non-menu controls.
200 * @elems: The number of elements in the N-dimensional array.
201 * @elem_size: The size in bytes of the control.
204 * @menu_skip_mask: The control's skip mask for menu controls. This makes it
211 * empty strings ("") correspond to non-existing menu items (this
215 * @qmenu_int: A 64-bit integer array for with integer menu items.
217 * :math:`ceil(\frac{maximum - minimum}{step}) + 1`.
219 * @flags: The control's flags.
221 * @cur.val: The control's current value, if the @type is represented via
223 * @val: The control's new s32 value.
224 * @priv: The control's private pointer. For use by the driver. It is
225 * untouched by the control framework. Note that this pointer is
226 * not freed when the control is deleted. Should this be needed
229 * @p_def: The control's default value represented via a union which
230 * provides a standard way of accessing control types
232 * @p_cur: The control's current value represented via a union which
233 * provides a standard way of accessing control types
235 * @p_new: The control's new value represented via a union which provides
236 * a standard way of accessing control types
292 * struct v4l2_ctrl_ref - The control reference.
295 * @next: Single-link list node for the hash.
296 * @ctrl: The actual control information.
298 * ``prepare_ext_ctrls`` function at ``v4l2-ctrl.c``.
301 * @req_done: Internal flag: if the control handler containing this control
303 * the control has been applied. This prevents applying controls
305 * control of a cluster is applied, they all are).
306 * @req: If set, this refers to another request that sets this control.
307 * @p_req: If the control handler containing this control reference
309 * value of the control that should be applied when the request
310 * is executed, or to the value of the control at the time
313 * Each control handler has a list of these refs. The list_head is used to
314 * keep a sorted-by-control-ID list of all controls, while the next pointer
315 * is used to link the control in the hash's bucket.
329 * struct v4l2_ctrl_handler - The control handler keeps track of all the
334 * @lock: Lock to control access to this handler and its controls.
337 * @ctrl_refs: The list of control references.
338 * @cached: The last found control reference. It is common that the same
339 * control is needed multiple times, so this is a simple
341 * @buckets: Buckets for the hashing. Allows for quick control lookup.
342 * @notify: A notify callback that is called whenever the control changes
348 * @error: The error code of the first failed control addition.
350 * @requests: List to keep track of open control handler request objects.
351 * For the parent control handler (@req_obj.req == NULL) this
352 * is the list header. When the parent control handler is
354 * they refer to the parent.
379 * struct v4l2_ctrl_config - Control configuration structure.
381 * @ops: The control ops.
382 * @type_ops: The control type ops. Only needed for compound controls.
383 * @id: The control ID.
384 * @name: The control name.
385 * @type: The control type.
386 * @min: The control's minimum value.
387 * @max: The control's maximum value.
388 * @step: The control's step value for non-menu controls.
389 * @def: The control's default value.
390 * @p_def: The control's default value for compound controls.
392 * @elem_size: The size in bytes of the control.
393 * @flags: The control's flags.
394 * @menu_skip_mask: The control's skip mask for menu controls. This makes it
401 * empty strings ("") correspond to non-existing menu items (this
406 * @is_private: If set, then this control is private to its handler and it
430 * v4l2_ctrl_fill - Fill in the control fields based on the control ID.
432 * @id: ID of the control
433 * @name: pointer to be filled with a string with the name of the control
434 * @type: pointer for storing the type of the control
435 * @min: pointer for storing the minimum value for the control
436 * @max: pointer for storing the maximum value for the control
437 * @step: pointer for storing the control step
438 * @def: pointer for storing the default value for the control
439 * @flags: pointer for storing the flags to be used on the control
442 * For non-standard controls it will only fill in the given arguments
452 * control handling only. Once all drivers are converted to use the new
453 * control framework this function will no longer be exported.
460 * v4l2_ctrl_handler_init_class() - Initialize the control handler.
461 * @hdl: The control handler.
466 * are allocated) or the control lookup becomes slower (not enough
478 * error will also be stored in @hdl->error.
487 * v4l2_ctrl_handler_init - helper function to create a static struct
490 * @hdl: The control handler.
495 * are allocated) or the control lookup becomes slower (not enough
503 * Use this helper function to initialize a control handler.
513 "(" #hdl ")->_lock"); \
522 * v4l2_ctrl_handler_free() - Free all controls owned by the handler and free
523 * the control list.
524 * @hdl: The control handler.
531 * v4l2_ctrl_lock() - Helper function to lock the handler
532 * associated with the control.
533 * @ctrl: The control to lock.
537 mutex_lock(ctrl->handler->lock); in v4l2_ctrl_lock()
541 * v4l2_ctrl_unlock() - Helper function to unlock the handler
542 * associated with the control.
543 * @ctrl: The control to unlock.
547 mutex_unlock(ctrl->handler->lock); in v4l2_ctrl_unlock()
551 * __v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging
552 * to the handler to initialize the hardware to the current control values. The
553 * caller is responsible for acquiring the control handler mutex on behalf of
555 * @hdl: The control handler.
557 * Button controls will be skipped, as are read-only controls.
564 * v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging
565 * to the handler to initialize the hardware to the current control values.
566 * @hdl: The control handler.
568 * Button controls will be skipped, as are read-only controls.
575 * v4l2_ctrl_handler_log_status() - Log all controls owned by the handler.
576 * @hdl: The control handler.
577 * @prefix: The prefix to use when logging the control values. If the
590 * v4l2_ctrl_new_custom() - Allocate and initialize a new custom V4L2
591 * control.
593 * @hdl: The control handler.
594 * @cfg: The control's configuration data.
595 * @priv: The control's driver-specific private data.
598 * and @hdl->error is set to the error code (if it wasn't set already).
605 * v4l2_ctrl_new_std() - Allocate and initialize a new standard V4L2 non-menu
606 * control.
608 * @hdl: The control handler.
609 * @ops: The control ops.
610 * @id: The control ID.
611 * @min: The control's minimum value.
612 * @max: The control's maximum value.
613 * @step: The control's step value
614 * @def: The control's default value.
616 * If the &v4l2_ctrl struct could not be allocated, or the control
617 * ID is not known, then NULL is returned and @hdl->error is set to the
620 * If @id refers to a menu control, then this function will return NULL.
630 * v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2
631 * menu control.
633 * @hdl: The control handler.
634 * @ops: The control ops.
635 * @id: The control ID.
636 * @max: The control's maximum value.
637 * @mask: The control's skip mask for menu controls. This makes it
643 * @def: The control's default value.
648 * If @id refers to a non-menu control, then this function will return NULL.
655 * v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control
658 * @hdl: The control handler.
659 * @ops: The control ops.
660 * @id: The control ID.
661 * @max: The control's maximum value.
662 * @mask: The control's skip mask for menu controls. This makes it
668 * @def: The control's default value.
672 * menu of this control.
682 * v4l2_ctrl_new_std_compound() - Allocate and initialize a new standard V4L2
683 * compound control.
685 * @hdl: The control handler.
686 * @ops: The control ops.
687 * @id: The control ID.
688 * @p_def: The control's default value.
693 * compound control should be all zeroes.
702 * v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control.
704 * @hdl: The control handler.
705 * @ops: The control ops.
706 * @id: The control ID.
707 * @max: The control's maximum value.
708 * @def: The control's default value.
709 * @qmenu_int: The control's menu entries.
714 * If @id refers to a non-integer-menu control, then this function will
723 * typedef v4l2_ctrl_filter - Typedef to define the filter function to be
724 * used when adding a control handler.
732 * v4l2_ctrl_add_handler() - Add all controls from handler @add to
735 * @hdl: The control handler.
736 * @add: The control handler whose controls you want to add to
737 * the @hdl control handler.
745 * In case of an error @hdl->error will be set to the error code (if it
754 * v4l2_ctrl_radio_filter() - Standard filter for radio controls.
756 * @ctrl: The control that is filtered.
767 * v4l2_ctrl_cluster() - Mark all controls in the cluster as belonging
771 * @controls: The cluster control array of size @ncontrols.
777 * v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging
778 * to that cluster and set it up for autofoo/foo-type handling.
781 * @controls: The cluster control array of size @ncontrols. The first control
782 * must be the 'auto' control (e.g. autogain, autoexposure, etc.)
783 * @manual_val: The value for the first control in the cluster that equals the
785 * @set_volatile: If true, then all controls except the first auto control will
788 * Use for control groups where one control selects some automatic feature and
790 * off (manual mode). Typical examples: autogain vs gain, auto-whitebalance vs
795 * When the autofoo control is set to automatic, then any manual controls
796 * are set to inactive and any reads will call g_volatile_ctrl (if the control
799 * When the autofoo control is set to manual, then any manual controls will
804 * on the autofoo control and %V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
813 * v4l2_ctrl_find() - Find a control with the given ID.
815 * @hdl: The control handler.
816 * @id: The control ID to find.
824 * v4l2_ctrl_activate() - Make the control active or inactive.
825 * @ctrl: The control to (de)activate.
826 * @active: True if the control should become active.
833 * This function assumes that the control handler is locked.
838 * __v4l2_ctrl_grab() - Unlocked variant of v4l2_ctrl_grab.
840 * @ctrl: The control to (de)activate.
841 * @grabbed: True if the control should become grabbed.
849 * This function assumes that the control handler is locked by the caller.
854 * v4l2_ctrl_grab() - Mark the control as grabbed or not grabbed.
856 * @ctrl: The control to (de)activate.
857 * @grabbed: True if the control should become grabbed.
865 * This function assumes that the control handler is not locked and will
879 *__v4l2_ctrl_modify_range() - Unlocked variant of v4l2_ctrl_modify_range()
881 * @ctrl: The control to update.
882 * @min: The control's minimum value.
883 * @max: The control's maximum value.
884 * @step: The control's step value
885 * @def: The control's default value.
887 * Update the range of a control on the fly. This works for control types
892 * control type.
894 * The caller is responsible for acquiring the control handler mutex on behalf
901 * v4l2_ctrl_modify_range() - Update the range of a control.
903 * @ctrl: The control to update.
904 * @min: The control's minimum value.
905 * @max: The control's maximum value.
906 * @step: The control's step value
907 * @def: The control's default value.
909 * Update the range of a control on the fly. This works for control types
914 * control type.
916 * This function assumes that the control handler is not locked and will
932 * v4l2_ctrl_notify() - Function to set a notify callback for a control.
934 * @ctrl: The control.
938 * This function sets a callback function for the control. If @ctrl is NULL,
949 * v4l2_ctrl_get_name() - Get the name of the control
951 * @id: The control ID.
953 * This function returns the name of the given control ID or NULL if it isn't
954 * a known control.
959 * v4l2_ctrl_get_menu() - Get the menu string array of the control
961 * @id: The control ID.
963 * This function returns the NULL-terminated menu string array name of the
964 * given control ID or NULL if it isn't a known menu control.
969 * v4l2_ctrl_get_int_menu() - Get the integer menu array of the control
971 * @id: The control ID.
974 * This function returns the integer array of the given control ID or NULL if it
975 * if it isn't a known integer menu control.
980 * v4l2_ctrl_g_ctrl() - Helper function to get the control's value from
983 * @ctrl: The control.
985 * This returns the control's value safely by going through the control
986 * framework. This function will lock the control's handler, so it cannot be
994 * __v4l2_ctrl_s_ctrl() - Unlocked variant of v4l2_ctrl_s_ctrl().
996 * @ctrl: The control.
999 * This sets the control's new value safely by going through the control
1000 * framework. This function assumes the control's handler is already locked,
1008 * v4l2_ctrl_s_ctrl() - Helper function to set the control's value from
1010 * @ctrl: The control.
1013 * This sets the control's new value safely by going through the control
1014 * framework. This function will lock the control's handler, so it cannot be
1031 * v4l2_ctrl_g_ctrl_int64() - Helper function to get a 64-bit control's value
1034 * @ctrl: The control.
1036 * This returns the control's value safely by going through the control
1037 * framework. This function will lock the control's handler, so it cannot be
1040 * This function is for 64-bit integer type controls only.
1045 * __v4l2_ctrl_s_ctrl_int64() - Unlocked variant of v4l2_ctrl_s_ctrl_int64().
1047 * @ctrl: The control.
1050 * This sets the control's new value safely by going through the control
1051 * framework. This function assumes the control's handler is already locked,
1054 * This function is for 64-bit integer type controls only.
1059 * v4l2_ctrl_s_ctrl_int64() - Helper function to set a 64-bit control's value
1062 * @ctrl: The control.
1065 * This sets the control's new value safely by going through the control
1066 * framework. This function will lock the control's handler, so it cannot be
1069 * This function is for 64-bit integer type controls only.
1083 * __v4l2_ctrl_s_ctrl_string() - Unlocked variant of v4l2_ctrl_s_ctrl_string().
1085 * @ctrl: The control.
1088 * This sets the control's new string safely by going through the control
1089 * framework. This function assumes the control's handler is already locked,
1097 * v4l2_ctrl_s_ctrl_string() - Helper function to set a control's string value
1100 * @ctrl: The control.
1103 * This sets the control's new string safely by going through the control
1104 * framework. This function will lock the control's handler, so it cannot be
1121 * __v4l2_ctrl_s_ctrl_compound() - Unlocked variant to set a compound control
1123 * @ctrl: The control.
1127 * This sets the control's new compound payload safely by going through the
1128 * control framework. This function assumes the control's handler is already
1137 * v4l2_ctrl_s_ctrl_compound() - Helper function to set a compound control
1140 * @ctrl: The control.
1144 * This sets the control's new compound payload safely by going through the
1145 * control framework. This function will lock the control's handler, so it
1169 /* Internal helper functions that deal with control events. */
1173 * v4l2_ctrl_replace - Function to be used as a callback to
1184 * v4l2_ctrl_merge - Function to be used as a callback to
1195 * v4l2_ctrl_log_status - helper function to implement %VIDIOC_LOG_STATUS ioctl
1207 * v4l2_ctrl_subscribe_event - Subscribes to an event
1214 * control events.
1220 * v4l2_ctrl_poll - function to be used as a callback to the poll()
1221 * That just polls for control events.
1229 * v4l2_ctrl_request_setup - helper function to apply control values in a request
1232 * @parent: The parent control handler ('priv' in media_request_object_find())
1234 * This is a helper function to call the control handler's s_ctrl callback with
1235 * the control values contained in the request. Do note that this approach of
1236 * applying control values in a request is only applicable to memory-to-memory
1240 struct v4l2_ctrl_handler *parent);
1243 * v4l2_ctrl_request_complete - Complete a control handler request object
1246 * @parent: The parent control handler ('priv' in media_request_object_find())
1248 * This function is to be called on each control handler that may have had a
1249 * request object associated with it, i.e. control handlers of a driver that
1252 * The function first obtains the values of any volatile controls in the control
1257 struct v4l2_ctrl_handler *parent);
1260 * v4l2_ctrl_request_hdl_find - Find the control handler in the request
1263 * @parent: The parent control handler ('priv' in media_request_object_find())
1265 * This function finds the control handler in the request. It may return
1278 struct v4l2_ctrl_handler *parent);
1281 * v4l2_ctrl_request_hdl_put - Put the control handler
1283 * @hdl: Put this control handler
1285 * This function released the control handler previously obtained from'
1291 media_request_object_put(&hdl->req_obj); in v4l2_ctrl_request_hdl_put()
1295 * v4l2_ctrl_request_ctrl_find() - Find a control with the given ID.
1297 * @hdl: The control handler from the request.
1298 * @id: The ID of the control to find.
1300 * This function returns a pointer to the control if this control is
1309 * v4l2_queryctrl - Helper function to implement
1315 * If hdl == NULL then they will all return -EINVAL.
1320 * v4l2_query_ext_ctrl - Helper function to implement
1326 * If hdl == NULL then they will all return -EINVAL.
1332 * v4l2_querymenu - Helper function to implement
1338 * If hdl == NULL then they will all return -EINVAL.
1343 * v4l2_g_ctrl - Helper function to implement
1349 * If hdl == NULL then they will all return -EINVAL.
1354 * v4l2_s_ctrl - Helper function to implement
1362 * If hdl == NULL then they will all return -EINVAL.
1368 * v4l2_g_ext_ctrls - Helper function to implement
1376 * If hdl == NULL then they will all return -EINVAL.
1382 * v4l2_try_ext_ctrls - Helper function to implement
1390 * If hdl == NULL then they will all return -EINVAL.
1398 * v4l2_s_ext_ctrls - Helper function to implement
1407 * If hdl == NULL then they will all return -EINVAL.
1415 * v4l2_ctrl_subdev_subscribe_event - Helper function to implement
1417 * that just subscribes control events.
1427 * v4l2_ctrl_subdev_log_status - Log all controls owned by subdev's control
1435 * v4l2_ctrl_new_fwnode_properties() - Register controls for the device
1447 * - V4L2_CID_CAMERA_ORIENTATION
1448 * - V4L2_CID_CAMERA_SENSOR_ROTATION;
1450 * Controls already registered by the caller with the @hdl control handler are