STRUCT V4L2_SUBDEV_PAD_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

struct v4l2_subdev_pad_ops β€” v4l2-subdev pad level operations. Okay bestie, this page is from the Kernel API Manual, and it’s literally the pad-level ops struct for v4l2 subdevs. Main character energy, no cap. πŸ¦‹


✨ SYNOPSIS ✨

Here’s the whole struct, copied exactly because code gets zero vibes-based edits, periodt:

struct v4l2_subdev_pad_ops {
    int (*enum_mbus_code)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_mbus_code_enum *code);
    int (*enum_frame_size)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_frame_size_enum *fse);
    int (*enum_frame_interval)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_frame_interval_enum *fie);
    int (*get_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_state
*state, struct v4l2_subdev_format *format);
    int (*set_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_state
*state, struct v4l2_subdev_format *format);
    int (*get_selection)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_selection *sel);
    int (*set_selection)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_selection *sel);
    int (*get_frame_interval)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_frame_interval *interval);
    int (*set_frame_interval)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, struct v4l2_subdev_frame_interval *interval);
    int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
    int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
    int (*s_dv_timings)(struct v4l2_subdev *sd, unsigned int pad, struct
v4l2_dv_timings *timings);
    int (*g_dv_timings)(struct v4l2_subdev *sd, unsigned int pad, struct
v4l2_dv_timings *timings);
    int (*query_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_dv_timings *timings);
    int (*dv_timings_cap)(struct v4l2_subdev *sd, struct
v4l2_dv_timings_cap *cap);
    int (*enum_dv_timings)(struct v4l2_subdev *sd, struct
v4l2_enum_dv_timings *timings);
  #ifdef CONFIG_MEDIA_CONTROLLER;
    int (*link_validate)(struct v4l2_subdev *sd, struct media_link
*link, struct v4l2_subdev_format *source_fmt, struct v4l2_subdev_format
*sink_fmt);
  #endif ;
    int (*get_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_frame_desc *fd);
    int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_frame_desc *fd);
    int (*get_mbus_config)(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config);
    int (*set_routing)(struct v4l2_subdev *sd, struct v4l2_subdev_state
*state, enum v4l2_subdev_format_whence which, struct
v4l2_subdev_krouting *route);
    int (*enable_streams)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, u32 pad, u64 streams_mask);
    int (*disable_streams)(struct v4l2_subdev *sd, struct
v4l2_subdev_state *state, u32 pad, u64 streams_mask);
        };

πŸŽ€ Members πŸŽ€

Here’s the whole callback roster β€” no skips, no cuts, every one is a main character. πŸ’…

  • enum_mbus_code β€” callback for the VIDIOC_SUBDEV_ENUM_MBUS_CODE ioctl handler code. ✨
  • enum_frame_size β€” callback for the VIDIOC_SUBDEV_ENUM_FRAME_SIZE ioctl handler code.
  • enum_frame_interval β€” callback for the VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL ioctl handler code.
  • get_fmt β€” callback for the VIDIOC_SUBDEV_G_FMT ioctl handler code.
  • set_fmt β€” callback for the VIDIOC_SUBDEV_S_FMT ioctl handler code.
  • get_selection β€” callback for the VIDIOC_SUBDEV_G_SELECTION ioctl handler code.
  • set_selection β€” callback for the VIDIOC_SUBDEV_S_SELECTION ioctl handler code.
  • get_frame_interval β€” callback for the VIDIOC_SUBDEV_G_FRAME_INTERVAL ioctl handler code.
  • set_frame_interval β€” callback for the VIDIOC_SUBDEV_S_FRAME_INTERVAL ioctl handler code.
  • get_edid β€” callback for the VIDIOC_SUBDEV_G_EDID ioctl handler code.
  • set_edid β€” callback for the VIDIOC_SUBDEV_S_EDID ioctl handler code.
  • s_dv_timings β€” Set custom dv timings in the sub device. This is used when sub device is capable of setting detailed timing information in the hardware to generate/detect the video signal.
  • g_dv_timings β€” Get custom dv timings in the sub device.
  • query_dv_timings β€” callback for the VIDIOC_QUERY_DV_TIMINGS ioctl handler code.
  • dv_timings_cap β€” callback for the VIDIOC_SUBDEV_DV_TIMINGS_CAP ioctl handler code.
  • enum_dv_timings β€” callback for the VIDIOC_SUBDEV_ENUM_DV_TIMINGS ioctl handler code.
  • link_validate β€” used by the media controller code to check if the links that belongs to a pipeline can be used for stream. Lowkey lives inside the #ifdef CONFIG_MEDIA_CONTROLLER; part of the struct.
  • get_frame_desc β€” get the current low level media bus frame parameters.
  • set_frame_desc β€” set the low level media bus frame parameters, fd array may be adjusted by the subdev driver to device capabilities.
  • get_mbus_config β€” get the media bus configuration of a remote sub-device. The media bus configuration is usually retrieved from the firmware interface at sub-device probe time, immediately applied to the hardware and eventually adjusted by the driver. Remote sub-devices (usually video receivers) shall use this operation to query the transmitting end bus configuration in order to adjust their own one accordingly. Callers should make sure they get the most up-to-date as possible configuration from the remote end, likely calling this operation as close as possible to stream on time. The operation shall fail if the pad index it has been called on is not valid or in case of unrecoverable failures. The config argument has been memset to 0 just before calling the op. 🫢
  • set_routing β€” Enable or disable data connection routes described in the subdevice routing table. Subdevs that implement this operation must set the V4L2_SUBDEV_FL_STREAMS flag.
  • enable_streams β€” Enable the streams defined in streams_mask on the given source pad. Subdevs that implement this operation must use the active state management provided by the subdev core (enabled through a call to v4l2_subdev_init_finalize at initialization time). Do not call directly, use v4l2_subdev_enable_streams instead.
  • disable_streams β€” Disable the streams defined in streams_mask on the given source pad. Subdevs that implement this operation must use the active state management provided by the subdev core (enabled through a call to v4l2_subdev_init_finalize at initialization time). Do not call directly, use v4l2_subdev_disable_streams instead.

🌸 Description 🌸

Not me reading the Description and seeing the exact same sentence twice 😭 but honestly? Periodt. Here are both copies so nothing gets lost, bestie:

Drivers that support only a single stream without setting the V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask argument.

Drivers that support only a single stream without setting the V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask argument.

Yes, literally the same line twice. The original said it, so we said it. πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

Okay these are all the related pages and APIs β€” full squad, no cuts, all the (9)s staying exactly as they are:

mwah πŸ’‹ that’s the whole page, bestie! source ./include/media, October 2026, struct v4l2_subdev_pad_ops(9) β€” go off, kernel queen 🫢✨

πŸ“¦ where this page comes from