set_mode(9)
π set_mode β like, the tuner's whole personality switch
okay bestie, so this one's from the Kernel API Manual (section 9, the kernel API girlies β¨) and it's called set_mode. it's giving "one tiny function, one big vibe change." let's get into it π
β¨ SYNOPSIS β¨
int set_mode (struct tuner *t , enum v4l2_tuner_type mode );
that's it. that's the whole signature. short and iconic π
π«Ά ARGUMENTS π«Ά
tβ a pointer to the module's internalstruct_tuner. like, the tuner's whole self. its main character data structure πmodeβ anenum v4l2_type, and it's either radio or TV. that's the vibe we're switching to, no in-between πΈ
π₯ DESCRIPTION π₯
so here's the tea. set_mode switches the tuner over to another mode. dramatic? a little. necessary? absolutely.
the way it works is: if the tuner doesn't support the mode you're asking for (radio or TV), it prints a debug message and returns -EINVAL β and lowkey that's not all, because it also changes its state to standby. so it's like "no bestie, i can't do that" and then it just sits down π
otherwise β and this is the slay case β it changes the mode and returns 0. success. we love to see it. periodt π
ngl, if you're getting -EINVAL back, check that your mode is actually one of the supported ones (radio or TV) before you start blaming the driver. the tuner's just being honest with you π«Ά
π SEE ALSO π
everything else in this little kernel-family group chat, starting with the kernel file itself:
- Kernel file
./drivers/media/v4l2-core/tuner-core.c enum tuner_pad_index(9)enum if_vid_dec_pad_index(9)set_type(9)tuner_s_type_addr(9)tuner_s_config(9)tuner_lookup(9)tuner_probe(9)tuner_remove(9)check_mode(9)set_freq(9)set_tv_freq(9)tuner_fixup_std(9)set_radio_freq(9)tuner_status(9)tuner_standby(9)tuner_g_frequency(9)tuner_g_tuner(9)tuner_s_tuner(9)
that's the whole squad, iykyk π
and that's the page, bestie π¦ this little gem lives at ./drivers/media/v4l2-core, dated October 2026, and it's filed under set_mode(9) β so go forth and switch modes responsibly, 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