include/media/v4l2-subdev.h
Source file repositories/reference/linux-study-clean/include/media/v4l2-subdev.h
File Facts
- System
- Linux kernel
- Corpus path
include/media/v4l2-subdev.h- Extension
.h- Size
- 78399 bytes
- Lines
- 2055
- 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/types.hlinux/v4l2-subdev.hmedia/media-entity.hmedia/v4l2-async.hmedia/v4l2-common.hmedia/v4l2-dev.hmedia/v4l2-fh.hmedia/v4l2-mediabus.h
Detected Declarations
struct v4l2_devicestruct v4l2_ctrl_handlerstruct v4l2_eventstruct v4l2_event_subscriptionstruct v4l2_fhstruct v4l2_subdevstruct v4l2_subdev_fhstruct v4l2_subdev_stream_configstruct tuner_setupstruct v4l2_mbus_frame_descstruct led_classdevstruct v4l2_decode_vbi_linestruct v4l2_subdev_io_pin_configstruct v4l2_subdev_core_opsstruct v4l2_subdev_tuner_opsstruct v4l2_subdev_audio_opsstruct v4l2_mbus_frame_desc_entry_csi2struct v4l2_mbus_frame_desc_entrystruct v4l2_mbus_frame_descstruct v4l2_subdev_video_opsstruct v4l2_subdev_vbi_opsstruct v4l2_subdev_sensor_opsstruct v4l2_subdev_ir_parametersstruct v4l2_subdev_ir_opsstruct v4l2_subdev_pad_configstruct v4l2_subdev_stream_configsstruct v4l2_subdev_kroutingstruct v4l2_subdev_statestruct v4l2_subdev_pad_opsstruct v4l2_subdev_opsstruct v4l2_subdev_internal_opsstruct regulator_bulk_datastruct v4l2_subdev_platform_datastruct v4l2_subdevstruct v4l2_subdev_fhenum v4l2_subdev_io_pin_bitsenum v4l2_mbus_frame_desc_flagsenum v4l2_mbus_frame_desc_typeenum v4l2_subdev_pre_streamon_flagsenum v4l2_subdev_ir_modeenum v4l2_subdev_routing_restrictionfunction v4l2_set_subdevdatafunction v4l2_set_subdev_hostdatafunction v4l2_subdev_lock_statefunction v4l2_subdev_unlock_statefunction v4l2_subdev_unlock_statesfunction v4l2_subdev_unlock_statesfunction v4l2_subdev_get_unlocked_active_state
Annotated Snippet
struct v4l2_decode_vbi_line {
u32 is_second_field;
u8 *p;
u32 line;
u32 type;
};
/*
* Sub-devices are devices that are connected somehow to the main bridge
* device. These devices are usually audio/video muxers/encoders/decoders or
* sensors and webcam controllers.
*
* Usually these devices are controlled through an i2c bus, but other buses
* may also be used.
*
* The v4l2_subdev struct provides a way of accessing these devices in a
* generic manner. Most operations that these sub-devices support fall in
* a few categories: core ops, audio ops, video ops and tuner ops.
*
* More categories can be added if needed, although this should remain a
* limited set (no more than approx. 8 categories).
*
* Each category has its own set of ops that subdev drivers can implement.
*
* A subdev driver can leave the pointer to the category ops NULL if
* it does not implement them (e.g. an audio subdev will generally not
* implement the video category ops). The exception is the core category:
* this must always be present.
*
* These ops are all used internally so it is no problem to change, remove
* or add ops or move ops from one to another category. Currently these
* ops are based on the original ioctls, but since ops are not limited to
* one argument there is room for improvement here once all i2c subdev
* drivers are converted to use these ops.
*/
/*
* Core ops: it is highly recommended to implement at least these ops:
*
* log_status
* g_register
* s_register
*
* This provides basic debugging support.
*
* The ioctl ops is meant for generic ioctl-like commands. Depending on
* the use-case it might be better to use subdev-specific ops (currently
* not yet implemented) since ops provide proper type-checking.
*/
/**
* enum v4l2_subdev_io_pin_bits - Subdevice external IO pin configuration
* bits
*
* @V4L2_SUBDEV_IO_PIN_DISABLE: disables a pin config. ENABLE assumed.
* @V4L2_SUBDEV_IO_PIN_OUTPUT: set it if pin is an output.
* @V4L2_SUBDEV_IO_PIN_INPUT: set it if pin is an input.
* @V4L2_SUBDEV_IO_PIN_SET_VALUE: to set the output value via
* &struct v4l2_subdev_io_pin_config->value.
* @V4L2_SUBDEV_IO_PIN_ACTIVE_LOW: pin active is bit 0.
* Otherwise, ACTIVE HIGH is assumed.
*/
enum v4l2_subdev_io_pin_bits {
V4L2_SUBDEV_IO_PIN_DISABLE = 0,
V4L2_SUBDEV_IO_PIN_OUTPUT = 1,
V4L2_SUBDEV_IO_PIN_INPUT = 2,
V4L2_SUBDEV_IO_PIN_SET_VALUE = 3,
V4L2_SUBDEV_IO_PIN_ACTIVE_LOW = 4,
};
/**
* struct v4l2_subdev_io_pin_config - Subdevice external IO pin configuration
*
* @flags: bitmask with flags for this pin's config, whose bits are defined by
* &enum v4l2_subdev_io_pin_bits.
* @pin: Chip external IO pin to configure
* @function: Internal signal pad/function to route to IO pin
* @value: Initial value for pin - e.g. GPIO output value
* @strength: Pin drive strength
*/
struct v4l2_subdev_io_pin_config {
u32 flags;
u8 pin;
u8 function;
u8 value;
u8 strength;
};
/**
* struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs
Annotation
- Immediate include surface: `linux/types.h`, `linux/v4l2-subdev.h`, `media/media-entity.h`, `media/v4l2-async.h`, `media/v4l2-common.h`, `media/v4l2-dev.h`, `media/v4l2-fh.h`, `media/v4l2-mediabus.h`.
- Detected declarations: `struct v4l2_device`, `struct v4l2_ctrl_handler`, `struct v4l2_event`, `struct v4l2_event_subscription`, `struct v4l2_fh`, `struct v4l2_subdev`, `struct v4l2_subdev_fh`, `struct v4l2_subdev_stream_config`, `struct tuner_setup`, `struct v4l2_mbus_frame_desc`.
- 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.