STRUCT V4L2_SUBDEV_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct v4l2_subdev_ops(9) β€” the Kernel API Manual, but make it make sense

okay so bestie, welcome to the Kernel API Manual ✨ we're talking about struct v4l2_subdev_ops today, and honestly? it's giving "the master contact list for a subdev" and I'm obsessed 🫢


🌸 NAME 🌸

struct v4l2_subdev_ops β€” Subdev operations πŸ’–

like, it's literally the ops bundle. that's the whole vibe.


✨ SYNOPSIS ✨

struct v4l2_subdev_ops {
    const struct v4l2_subdev_core_ops       *core;
    const struct v4l2_subdev_tuner_ops      *tuner;
    const struct v4l2_subdev_audio_ops      *audio;
    const struct v4l2_subdev_video_ops      *video;
    const struct v4l2_subdev_vbi_ops        *vbi;
    const struct v4l2_subdev_ir_ops         *ir;
    const struct v4l2_subdev_sensor_ops     *sensor;
    const struct v4l2_subdev_pad_ops        *pad;
 };

eight pointers. eight little slots. all const, all vibes πŸ”₯


πŸŽ€ Members πŸŽ€

so each of these is a pointer to its own ops struct, and the big energy detail here is: every single one of them can be NULL πŸ’€ like, no pressure, no cap. you pick which ones your subdev actually needs and leave the rest as NULL.

  • core β€” pointer to struct v4l2_subdev_core_ops. Can be NULL πŸ’…
  • tuner β€” pointer to struct v4l2_subdev_tuner_ops. Can be NULL πŸŽ€
  • audio β€” pointer to struct v4l2_subdev_audio_ops. Can be NULL πŸ“
  • video β€” pointer to struct v4l2_subdev_video_ops. Can be NULL πŸ¦‹
  • vbi β€” pointer to struct v4l2_subdev_vbi_ops. Can be NULL 🌸
  • ir β€” pointer to struct v4l2_subdev_ir_ops. Can be NULL 🧚
  • sensor β€” pointer to struct v4l2_subdev_sensor_ops. Can be NULL ⭐
  • pad β€” pointer to struct v4l2_subdev_pad_ops. Can be NULL πŸ’œ
fr fr, the Can be NULL on every single one is not a typo, it's the whole point. don't be out here assuming you gotta fill all eight, bestie 😭

πŸ‘‘ SEE ALSO πŸ‘‘

okay this is the part where the manpage goes full main-character and lists literally everything πŸ’€ but I respect it, so here's the entire squad, no skips, no cuts:

Kernel file ./include/media/v4l2-subdev.h struct v4l2_decode_vbi_line(9), enum v4l2_subdev_io_pin_bits(9), struct v4l2_subdev_io_pin_config(9), struct v4l2_subdev_core_ops(9), struct v4l2_subdev_tuner_ops(9), struct v4l2_subdev_audio_ops(9), struct v4l2_mbus_frame_desc_entry_csi2(9), enum v4l2_mbus_frame_desc_flags(9), struct v4l2_mbus_frame_desc_entry(9), enum v4l2_mbus_frame_desc_type(9), struct v4l2_mbus_frame_desc(9), enum v4l2_subdev_pre_streamon_flags(9), struct v4l2_subdev_video_ops(9), struct v4l2_subdev_vbi_ops(9), struct v4l2_subdev_sensor_ops(9), enum v4l2_subdev_ir_mode(9), struct v4l2_subdev_ir_parameters(9), struct v4l2_subdev_ir_ops(9), struct v4l2_subdev_pad_config(9), struct v4l2_subdev_stream_configs(9), struct v4l2_subdev_krouting(9), struct v4l2_subdev_state(9), struct v4l2_subdev_pad_ops(9), struct v4l2_subdev_internal_ops(9), struct v4l2_subdev_platform_data(9), struct v4l2_subdev(9), media_entity_to_v4l2_subdev(9), vdev_to_v4l2_subdev(9), struct v4l2_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), enum v4l2_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)

iykyk πŸ’… that's the whole friend group, and yeah, they're all coming to the function.


okay and before I let you go β€” this page lives in ./include/media, and it's dated October 2026. mwah, love that for us πŸ’œβœ¨ go read some headers bestie, you got this 🫢

πŸ“¦ where this page comes from