STRUCT V4L2_SUBDEV_SENSOR_OPS(9)
πΈ struct v4l2_subdev_sensor_ops(9) β the Kernel API Manual glow-up β¨
okay so this is the struct v4l2_subdev_sensor_ops page from the Kernel API Manual, bestie. it's short, it's sweet, it's giving "two function pointers and a dream" π
π NAME π
struct v4l2_subdev_sensor_ops β the v4l2-subdev sensor operations π
β¨ SYNOPSIS β¨
here's the whole vibe, literally the entire struct, no cap:
struct v4l2_subdev_sensor_ops {
int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines);
int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames);
};
two members. that's it. that's the girl π«Ά
π¦ Members π¦
okay so these are the two glow-up hooks, let me put you on:
g_skip_top_linesβ this one reports the number of lines at the top of the image to be skipped. why?? because some sensors are messy and always corrupt several top lines of the output image π (rude), OR they're stuffing their metadata up in there instead of actual picture. either way, this hook tells the rest of the stack "yeah girl, ignore the first however-many lines, they're not the real thing" πg_skip_framesβ this one reports the number of frames to skip at stream start. needed for those buggy sensors that generate faulty frames when they're turned on β like bestie waking up and needing a minute before she's camera-ready π. so we just throw away the first few frames and pretend we didn't see them π
π SEE ALSO π
this list is long β like, unhinged long β but I'm not skipping a single one, periodt. every single reference, right here, exactly as written π
first up, the actual source file:
Kernel file ./include/media/v4l2-subdev.h
and now the whole extended friend group π :
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)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_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)
like I said. unhinged. but we ate π
ngl if you're writing a sensor driver and your hardware corrupts top lines or spits out garbage frames on power-up, this struct is literally your bestie. go say hi π«Ά
and that's the page!! mwah π this cutie lives in ./include/media, and it's dated October 2026, filed under that iconic truncated title struct v4l2...v_sensor_ops(9) β iykyk β¨ππ
π¦ 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