STRUCT V4L2_SUBDEV_TUNER_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct v4l2_subdev_tuner_ops(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is a page from the kernel API manual, and it's literally all about struct v4l2_subdev_tuner_ops β€” the callback squad that shows up when your v4l device gets opened in radio mode. πŸ“»βœ¨


✨ NAME ✨

struct v4l2_subdev_tuner_ops β€” Callbacks used when v4l device was opened in radio mode.


πŸ¦‹ SYNOPSIS πŸ¦‹

struct v4l2_subdev_tuner_ops {
    int (*standby)(struct v4l2_subdev *sd);
    int (*s_radio)(struct v4l2_subdev *sd);
    int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
    int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
    int (*enum_freq_bands)(struct v4l2_subdev *sd, struct v4l2_frequency_band *band);
    int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
    int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt);
    int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
    int (*s_modulator)(struct v4l2_subdev *sd, const struct v4l2_modulator *vm);
    int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
    int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
 };

πŸ‘‘ Members πŸ‘‘

  • standby β€” puts the tuner in standby mode. bestie it does not need you to wake it up manually, it gets woken up automatically the next time it's used. main character energy honestly πŸ›Œβœ¨
  • s_radio β€” callback that switches the tuner to radio mode. drivers should explicitly call it when a tuner ops should operate on radio mode, before being able to handle it. Used on devices that have both AM/FM radio receiver and TV. πŸ“»πŸ“Ί
  • s_frequency β€” callback for VIDIOC_S_FREQUENCY ioctl handler code.
  • g_frequency β€” callback for VIDIOC_G_FREQUENCY ioctl handler code. freq->type must be filled in. Normally done by video_ioctl2 or the bridge driver. 🫢
  • enum_freq_bands β€” callback for VIDIOC_ENUM_FREQ_BANDS ioctl handler code.
  • g_tuner β€” callback for VIDIOC_G_TUNER ioctl handler code.
  • s_tuner β€” callback for VIDIOC_S_TUNER ioctl handler code. vt->type must be filled in. Normally done by video_ioctl2 or the bridge driver. ⭐
  • g_modulator β€” callback for VIDIOC_G_MODULATOR ioctl handler code.
  • s_modulator β€” callback for VIDIOC_S_MODULATOR ioctl handler code.
  • s_type_addr β€” sets tuner type and its I2C addr. πŸŽ€
  • s_config β€” sets tda9887 specific stuff, like port1, port2 and qss. πŸ’…

🌸 Description 🌸

NOTE: 🚨

On devices that have both AM/FM and TV, it is up to the driver to explicitly call s_radio when the tuner should be switched to radio mode, before handling other struct v4l2_subdev_tuner_ops that would require it. no cap, that's on the driver, not on the framework. πŸ™ˆ

An example of such usage is::

static void s_frequency(void *priv, const struct v4l2_frequency *f)
{
      ...
      if (f.type == V4L2_TUNER_RADIO)
              v4l2_device_call_all(v4l2_dev, 0, tuner, s_radio);
      ...
      v4l2_device_call_all(v4l2_dev, 0, tuner, s_frequency);
}

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/media/v4l2-subdev.h β€” and the whole extended friend group, fr fr:


and that's the whole vibe check, bestie πŸ’– this page lives in ./include/media, dated October 2026, and it's filed under struct v4l2_...ev_tuner_ops(9) β€” go off, you ate that πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from