STRUCT TUNER_PARAMS(9)
π struct tuner_params(9) π
Okay bestie, welcome to the Kernel API Manual entry for struct tuner_params, aka the little glow-up sheet that tells the kernel how to set up your tuner β¨
π NAME π
struct tuner_params β the parameters used to set up the tuner π
Lowkey important context: these are used by drivers/media/tuners/tuner-types.c in order to specify the tuner properties. And most of these parameters? They're for tuners based on the tda9887 IF-PLL multi-standard analog TV/Radio demodulator, which is very common on legacy analog tuners. No cap, that demodulator is everywhere in the old stuff π«Ά
β SYNOPSIS β
struct tuner_params {
enum param_type type;
unsigned int cb_first_if_lower_freq:1;
unsigned int has_tda9887:1;
unsigned int port1_fm_high_sensitivity:1;
unsigned int port2_fm_high_sensitivity:1;
unsigned int fm_gain_normal:1;
unsigned int intercarrier_mode:1;
unsigned int port1_active:1;
unsigned int port2_active:1;
unsigned int port1_invert_for_secam_lc:1;
unsigned int port2_invert_for_secam_lc:1;
unsigned int port1_set_for_fm_mono:1;
unsigned int default_pll_gating_18:1;
unsigned int radio_if:2;
signed int default_top_low:5;
signed int default_top_mid:5;
signed int default_top_high:5;
signed int default_top_secam_low:5;
signed int default_top_secam_mid:5;
signed int default_top_secam_high:5;
u16 iffreq;
unsigned int count;
const struct tuner_range *ranges;
};
Look at all those bitfields, she's thriving π¦
πΈ Members πΈ
typeβ the type of the tuner parameters, as defined atenum param_type. If the tuner supports multiple standards, an array should be used, with one row per different standard. Slay, organized queen πcb_first_if_lower_freqβ okay so many Philips-based tuners have a comment in their datasheet that goes a little something like this, and I quote: "For channel selection involving band switching, and to ensure smooth tuning to the desired channel without causing unnecessary charge pump action, it is recommended to consider the difference between wanted channel frequency and the current channel frequency. Unnecessary charge pump action will result in very low tuning voltage which may drive the oscillator to extreme conditions". Setcb_first_if_lower_freqto1if this check is required for this tuner. And the lore? I tested this for PAL by first setting the TV frequency to203 MHzand then switching to96.6 MHzFM radio. The result was static unless the control byte was sent first. π Iconic field, genuinely.has_tda9887β set to1if this tuner uses atda9887.port1_fm_high_sensitivityβ many Philips tuners usetda9887PORT1to select the FM radio sensitivity. If this setting is1, then setPORT1to1to get proper FM reception π»port2_fm_high_sensitivityβ some Philips tuners usetda9887PORT2to select the FM radio sensitivity. If this setting is1, then setPORT2to1to get proper FM reception πfm_gain_normalβ some Philips tuners usetda9887cGainNormalto select the FM radio sensitivity. If this setting is1, the e register will usecGainNormalinstead ofcGainLow.intercarrier_modeβ most tuners with atda9887use QSS mode. Some (cheaper) tuners use Intercarrier mode. If this setting is1, then the tuner needs to be set to intercarrier mode. Budget tuners stay budgeting πport1_activeβ this sets the default value forPORT1.0means inactive,1means active. Note: the actual bit value written to thetda9887is inverted. So a0here means a1in theB6bit. Sneaky little flip πport2_activeβ this sets the default value forPORT2.0means inactive,1means active. Note: the actual bit value written to thetda9887is inverted. So a0here means a1in theB7bit. Same energy, different bit β¨port1_invert_for_secam_lcβ sometimesPORT1is inverted when the SECAM-L' standard is selected. Set this bit to1if this is needed.port2_invert_for_secam_lcβ sometimesPORT2is inverted when the SECAM-L' standard is selected. Set this bit to1if this is needed.port1_set_for_fm_monoβ some cards requirePORT1to be1for mono Radio FM and0for stereo πΆdefault_pll_gating_18β select 18% (or according to datasheet 0%) L standard PLL gating, vs the driver default of36%. Choices were made, bestie.radio_ifβ the IF to use in radio mode. Tuners with a separate radio IF filter seem to use10.7, while those without use33.3for PAL/SECAM tuners and41.3for NTSC tuners. So:0=10.7,1=33.3,2=41.3. Three vibes, pick one πdefault_top_lowβ defaulttda9887TOP value in dB for the low band. Default is0. Range:-16:+15.default_top_midβ defaulttda9887TOP value in dB for the mid band. Default is0. Range:-16:+15.default_top_highβ defaulttda9887TOP value in dB for the high band. Default is0. Range:-16:+15.default_top_secam_lowβ defaulttda9887TOP value in dB for SECAM-L/L' for the low band. Default is0. Several tuners require a different TOP value for the SECAM-L/L' standards. Range:-16:+15.default_top_secam_midβ defaulttda9887TOP value in dB for SECAM-L/L' for the mid band. Default is0. Several tuners require a different TOP value for the SECAM-L/L' standards. Range:-16:+15.default_top_secam_highβ defaulttda9887TOP value in dB for SECAM-L/L' for the high band. Default is0. Several tuners require a different TOP value for the SECAM-L/L' standards. Range:-16:+15.iffreqβ the Intermediate frequency (IF) used by the tuner on digital mode π‘countβ the size of therangesarray. Gotta know how many you're working with, fr fr.rangesβ the array with the frequency ranges supported by the tuner π
π¦ SEE ALSO π¦
Kernel file ./include/media/tuner-types.h, plus these iconic siblings:
enum param_type(9)struct tuner_range(9)struct tunertype(9)
Bestie heads up: those1-bit fields are bitfields, so it's1or0and nothing in between. Don't come in with a2and expect a good time π
That's the whole page, you ate it, no crumbs π
Sourced from ./include/media (struct tuner_params(9), October 2026) β go forth and tune something iconic, mwah ππ§π
π¦ 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