STRUCT V4L2_SUBDEV_INTERNAL_OPS(9)
β¨ struct v4l2_subdev_internal_ops(9) β¨
okay so bestie, welcome to the Kernel API Manual π
this page is all about struct v4l2_subdev_internal_ops β the V4L2 subdev internal ops, and yes the ops are internal, meaning they're the framework's little secret, not yours π
π NAME π
struct v4l2_subdev_internal_ops β V4L2 subdev internal ops, literally the internal callback table for a V4L2 subdev π
πΈ SYNOPSIS πΈ
struct v4l2_subdev_internal_ops {
int (*init_state)(struct v4l2_subdev *sd, struct v4l2_subdev_state *state);
int (*registered)(struct v4l2_subdev *sd);
void (*unregistered)(struct v4l2_subdev *sd);
int (*open)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
int (*close)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
void (*release)(struct v4l2_subdev *sd);
};
look at that struct, it's giving "six little function pointers and a dream" π¦
π Members π
okay so here's the whole cast, no skips, no cap:
init_stateβ initializes the subdev state to the default values β¨registeredβ gets called when this subdev is registered. when it's called, thev4l2_devfield is already set to the correctv4l2_deviceπunregisteredβ gets called when this subdev is unregistered. when this one runs, thev4l2_devfield is still set to the correctv4l2_deviceπ«Άopenβ called when the subdev device node gets opened by an application πΈcloseβ called when the subdev device node gets closed. and bestie, heads up: it is possible forcloseto be called afterunregistered! π iykykreleaseβ called when the last user of the subdev device is gone. this happens after theunregisteredcallback, and when the last open filehandle to thev4l-subdevXdevice node was closed. if no device node was created for this sub-device, then thereleasecallback is called right after theunregisteredcallback π§ thereleasecallback is typically used to free the memory containing thev4l2_subdevstructure, and it is almost certainly required for any sub-device that sets theV4L2_SUBDEV_FL_HAS_DEVNODEflag π
π Description π
π¨ NOTE: Never call this from drivers, only the v4l2 framework can call these ops. like, literally, hands off π€ this is framework-only territory, no touching from driver-land π
π SEE ALSO π
the whole extended friend group, in order, no one left out π«Ά starting with the kernel file itself:
- Kernel file
./include/media/v4l2-subdev.h
and the structs, enums and friends:
- struct
v4l2_decode_vbi_line(9), enumv4l2_subdev_io_pin_bits(9), structv4l2_subdev_io_pin_config(9), structv4l2_subdev_core_ops(9), structv4l2_subdev_tuner_ops(9), structv4l2_subdev_audio_ops(9), structv4l2_mbus_frame_desc_entry_csi2(9), enumv4l2_mbus_frame_desc_flags(9), structv4l2_mbus_frame_desc_entry(9), enumv4l2_mbus_frame_desc_type(9), structv4l2_mbus_frame_desc(9), enumv4l2_subdev_pre_streamon_flags(9) - struct
v4l2_subdev_video_ops(9), structv4l2_subdev_vbi_ops(9), structv4l2_subdev_sensor_ops(9), enumv4l2_subdev_ir_mode(9), structv4l2_subdev_ir_parameters(9), structv4l2_subdev_ir_ops(9), structv4l2_subdev_pad_config(9), structv4l2_subdev_stream_configs(9), structv4l2_subdev_krouting(9), structv4l2_subdev_state(9), structv4l2_subdev_pad_ops(9), structv4l2_subdev_ops(9), structv4l2_subdev_platform_data(9), structv4l2_subdev(9) media_entity_to_v4l2_subdev(9),vdev_to_v4l2_subdev(9), structv4l2_subdev_fh(9),to_v4l2_subdev_fh(9),v4l2_set_subdevdata(9),v4l2_get_subdevdata(9),v4l2_set_subdev_hostdata(9),v4l2_get_subdev_hostdata(9),v4l2_subdev_get_fwnode_pad_1_to_1(9),v4l2_subdev_link_validate_default(9),v4l2_subdev_link_validate(9),v4l2_subdev_has_pad_interdep(9)__v4l2_subdev_state_alloc(9),__v4l2_subdev_state_free(9),v4l2_subdev_init_finalize(9),v4l2_subdev_cleanup(9),v4l2_subdev_state_get_format(9),v4l2_subdev_state_get_crop(9),v4l2_subdev_state_get_compose(9),v4l2_subdev_state_get_interval(9),v4l2_subdev_get_fmt(9),v4l2_subdev_get_frame_interval(9)v4l2_subdev_set_routing(9),for_each_active_route(9),v4l2_subdev_set_routing_with_fmt(9),v4l2_subdev_routing_find_opposite_end(9),v4l2_subdev_state_get_opposite_stream_format(9),v4l2_subdev_state_xlate_streams(9), enumv4l2_subdev_routing_restriction(9),v4l2_subdev_routing_validate(9)v4l2_subdev_enable_streams(9),v4l2_subdev_disable_streams(9),v4l2_subdev_s_stream_helper(9),__v4l2_subdev_get_frame_desc_passthrough(9),v4l2_subdev_get_frame_desc_passthrough(9)v4l2_subdev_lock_state(9),v4l2_subdev_unlock_state(9),v4l2_subdev_lock_states(9),v4l2_subdev_unlock_states(9),v4l2_subdev_get_unlocked_active_state(9),v4l2_subdev_get_locked_active_state(9),v4l2_subdev_lock_and_get_active_state(9)v4l2_subdev_init(9),v4l2_subdev_call(9),v4l2_subdev_call_state_active(9),v4l2_subdev_call_state_try(9),v4l2_subdev_has_op(9),v4l2_subdev_notify_event(9),v4l2_subdev_is_streaming(9)
and that's the page!! π this lil doc came from ./include/media, dated October 2026, and it's part of the Kernel API Manual β mwah, go read the source bestie, ilysm πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms