STRUCT DVB_TUNER_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct dvb_tuner_ops(9) ✨

okay so bestie, we're deep in the Kernel API Manual today and this one is literally the whole personality file for a tuner πŸ’… it's the info + the callbacks, all in one struct, and yes you're gonna want to read all of it, no skipping 🫢


🌸 SYNOPSIS 🌸

like, here's the whole vibe, verbatim, don't touch anything:

struct dvb_tuner_ops {
    struct dvb_tuner_info info;
    void (*release)(struct dvb_frontend *fe);
    int (*init)(struct dvb_frontend *fe);
    int (*sleep)(struct dvb_frontend *fe);
    int (*suspend)(struct dvb_frontend *fe);
    int (*resume)(struct dvb_frontend *fe);
    int (*set_params)(struct dvb_frontend *fe);
    int (*set_analog_params)(struct dvb_frontend *fe, struct
analog_parameters *p);
    int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
    int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
    int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
    int (*get_if_frequency)(struct dvb_frontend *fe, u32 *frequency);
  #define TUNER_STATUS_LOCKED 1;
  #define TUNER_STATUS_STEREO 2;
    int (*get_status)(struct dvb_frontend *fe, u32 *status);
    int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
    int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
    int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len);
    int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
    int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
 };

πŸŽ€ Members πŸŽ€

  • info β€” an embedded struct dvb_tuner_info holding the tuner's properties. it's giving "ID card but for a tuner" πŸͺͺ
  • release β€” callback fired when the frontend gets detached. drivers, pls free any memory you allocated, that's the whole assignment, no cap 😭
  • init β€” callback used to initialize the tuner device, the little glow-up before it does anything ✨
  • sleep β€” callback that puts the tuner to sleep 😴 nap time fr
  • suspend β€” callback to let you know the Kernel is about to suspend
  • resume β€” callback to let you know the Kernel is coming back from suspend, welcome back bestie πŸ¦‹
  • set_params β€” callback that tells the tuner to tune into a digital TV channel. the properties it uses live at struct dvb_frontend.dtv_property_cache. the tuner demod can change the parameters to reflect the changes needed for the channel to be tuned, and update statistics. this is the recommended way to set the tuner parameters and should be used on newer drivers πŸ‘‘ lowkey the main character of this struct
  • set_analog_params β€” callback used to tune into an analog TV channel on hybrid tuners. it passes analog_parameters to the driver πŸŽ€
  • set_config β€” callback used to send some tuner-specific parameters πŸ“¨
  • get_frequency β€” get the actual tuned frequency πŸ“»
  • get_bandwidth β€” get the bandwidth used by the low pass filters πŸŒ€
  • get_if_frequency β€” get the Intermediate Frequency, in Hz. for baseband, it should return 0. zero. nada. ✨
  • get_status β€” returns the frontend lock status πŸ”’ (and hey, remember the defines up top: TUNER_STATUS_LOCKED is 1; and TUNER_STATUS_STEREO is 2;)
  • get_rf_strength β€” returns the RF signal strength. used mostly to support analog TV and radio. digital TV should report, instead, via the DVBv5 API (struct dvb_frontend.dtv_property_cache). so like, don't do the wrong thing bestie πŸ™ˆ
  • get_afc β€” used only by the analog TV core. reports the frequency drift due to AFC 🫢
  • calc_regs β€” callback used to pass register data settings for simple tuners. shouldn't be used on newer drivers πŸ’€
  • set_frequency β€” set a new frequency. shouldn't be used on newer drivers πŸ’€
  • set_bandwidth β€” set a new frequency. shouldn't be used on newer drivers πŸ’€
yes, set_frequency and set_bandwidth both say "Set a new frequency" in the original. that's not me being lazy, that's just what it says. iconic of them honestly 😭

πŸ’œ NOTE πŸ’œ

the frequencies used on get_frequency and set_frequency are in Hz for terrestrial/cable, or kHz for satellite. units matter, bestie, do not mix them up or you will be debugging all night πŸŒ™


🌈 SEE ALSO 🌈

go read the Kernel file ./include/media/dvb_frontend.h struct, plus all of these cuties:


that's the whole page bestie, go forth and tune responsibly πŸ’…βœ¨

signed, sealed, delivered from ./include/media β€” dated October 2026 β€” and yes this is the struct dvb_tuner_ops(9) page, mwah πŸŽ€

πŸ“¦ where this page comes from