include/media/v4l2-ctrls.h
Source file repositories/reference/linux-study-clean/include/media/v4l2-ctrls.h
File Facts
- System
- Linux kernel
- Corpus path
include/media/v4l2-ctrls.h- Extension
.h- Size
- 57781 bytes
- Lines
- 1637
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/mutex.hlinux/videodev2.hmedia/media-request.h
Detected Declarations
struct filestruct poll_table_structstruct v4l2_ctrlstruct v4l2_ctrl_handlerstruct v4l2_ctrl_helperstruct v4l2_fhstruct v4l2_fwnode_device_propertiesstruct v4l2_subdevstruct v4l2_subscribed_eventstruct video_devicestruct v4l2_ctrl_opsstruct v4l2_ctrl_type_opsstruct v4l2_ctrlstruct v4l2_ctrl_refstruct v4l2_ctrl_handlerstruct v4l2_ctrl_configfunction v4l2_ctrl_ptr_createfunction v4l2_ctrl_lockfunction v4l2_ctrl_unlockfunction v4l2_ctrl_grabfunction v4l2_ctrl_modify_rangefunction v4l2_ctrl_modify_dimensionsfunction v4l2_ctrl_s_ctrlfunction v4l2_ctrl_s_ctrl_int64function v4l2_ctrl_s_ctrl_stringfunction v4l2_ctrl_s_ctrl_compoundfunction v4l2_ctrl_request_hdl_find
Annotated Snippet
struct v4l2_ctrl_ops {
int (*g_volatile_ctrl)(struct v4l2_ctrl *ctrl);
int (*try_ctrl)(struct v4l2_ctrl *ctrl);
int (*s_ctrl)(struct v4l2_ctrl *ctrl);
};
/**
* struct v4l2_ctrl_type_ops - The control type operations that the driver
* has to provide.
*
* @equal: return true if all ctrl->elems array elements are equal.
* @init: initialize the value for array elements from from_idx to ctrl->elems.
* @minimum: set the value to the minimum value of the control.
* @maximum: set the value to the maximum value of the control.
* @log: log the value.
* @validate: validate the value for ctrl->new_elems array elements.
* Return 0 on success and a negative value otherwise.
*/
struct v4l2_ctrl_type_ops {
bool (*equal)(const struct v4l2_ctrl *ctrl,
union v4l2_ctrl_ptr ptr1, union v4l2_ctrl_ptr ptr2);
void (*init)(const struct v4l2_ctrl *ctrl, u32 from_idx,
union v4l2_ctrl_ptr ptr);
void (*minimum)(const struct v4l2_ctrl *ctrl, u32 idx,
union v4l2_ctrl_ptr ptr);
void (*maximum)(const struct v4l2_ctrl *ctrl, u32 idx,
union v4l2_ctrl_ptr ptr);
void (*log)(const struct v4l2_ctrl *ctrl);
int (*validate)(const struct v4l2_ctrl *ctrl, union v4l2_ctrl_ptr ptr);
};
/**
* typedef v4l2_ctrl_notify_fnc - typedef for a notify argument with a function
* that should be called when a control value has changed.
*
* @ctrl: pointer to struct &v4l2_ctrl
* @priv: control private data
*
* This typedef definition is used as an argument to v4l2_ctrl_notify()
* and as an argument at struct &v4l2_ctrl_handler.
*/
typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
/**
* struct v4l2_ctrl - The control structure.
*
* @node: The list node.
* @ev_subs: The list of control event subscriptions.
* @handler: The handler that owns the control.
* @cluster: Point to start of cluster array.
* @ncontrols: Number of controls in cluster array.
* @done: Internal flag: set for each processed control.
* @is_new: Set when the user specified a new value for this control. It
* is also set when called from v4l2_ctrl_handler_setup(). Drivers
* should never set this flag.
* @has_changed: Set when the current value differs from the new value. Drivers
* should never use this flag.
* @is_private: If set, then this control is private to its handler and it
* will not be added to any other handlers. Drivers can set
* this flag.
* @is_auto: If set, then this control selects whether the other cluster
* members are in 'automatic' mode or 'manual' mode. This is
* used for autogain/gain type clusters. Drivers should never
* set this flag directly.
* @is_int: If set, then this control has a simple integer value (i.e. it
* uses ctrl->val).
* @is_string: If set, then this control has type %V4L2_CTRL_TYPE_STRING.
* @is_ptr: If set, then this control is an array and/or has type >=
* %V4L2_CTRL_COMPOUND_TYPES
* and/or has type %V4L2_CTRL_TYPE_STRING. In other words, &struct
* v4l2_ext_control uses field p to point to the data.
* @is_array: If set, then this control contains an N-dimensional array.
* @is_dyn_array: If set, then this control contains a dynamically sized 1-dimensional array.
* If this is set, then @is_array is also set.
* @has_volatiles: If set, then one or more members of the cluster are volatile.
* Drivers should never touch this flag.
* @call_notify: If set, then call the handler's notify function whenever the
* control's value changes.
* @manual_mode_value: If the is_auto flag is set, then this is the value
* of the auto control that determines if that control is in
* manual mode. So if the value of the auto control equals this
* value, then the whole cluster is in manual mode. Drivers should
* never set this flag directly.
* @ops: The control ops.
* @type_ops: The control type ops.
* @id: The control ID.
* @name: The control name.
* @type: The control type.
* @minimum: The control's minimum value.
* @maximum: The control's maximum value.
Annotation
- Immediate include surface: `linux/list.h`, `linux/mutex.h`, `linux/videodev2.h`, `media/media-request.h`.
- Detected declarations: `struct file`, `struct poll_table_struct`, `struct v4l2_ctrl`, `struct v4l2_ctrl_handler`, `struct v4l2_ctrl_helper`, `struct v4l2_fh`, `struct v4l2_fwnode_device_properties`, `struct v4l2_subdev`, `struct v4l2_subscribed_event`, `struct video_device`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.