check_mode(9)
π check_mode(9) β the Kernel API Manual moment π
okay so bestie, we're in the check_mode(9) page and honestly it's giving "tiny function, big responsibilities" β¨
πΈ NAME πΈ
check_mode β literally just verifying whether your tuner can even do the mode you're asking for π
β¨ SYNOPSIS β¨
int check_mode (struct tuner *t , enum v4l2_tuner_type mode );
π¦ ARGUMENTS π¦
tβ a pointer to the module's internalstruct_tuner. yep, the whole struct, hand it over π«Άmodeβ the mode of the tuner, as defined byenum v4l2_tuner_type. it's giving "which vibe are we tuning to" π
π DESCRIPTION π
so what does this actually do? it checks if the tuner is capable of tuning analog TV, digital TV or radio, depending on what the caller wants. that's it, that's the whole job, and it eats every time π₯
if the tuner can't support that mode, it returns -EINVAL π. otherwise, it returns 0 and everyone lives happily ever after β¨
and like, why do we even need this? because some boards have a separate tuner for radio (think devices with tea5767) β so yes bestie, the vibe check is necessary, no cap π
β οΈ NOTE β οΈ
real talk, this one's important: mt20xx uses V4L2_TUNER_DIGITAL_TV and calls set_tv_freq to select a TV frequency. so t_mode = T_ANALOG_TV could actually be used to represent a Digital TV too π€― like, the naming is a little sneaky, iykyk π
π SEE ALSO π
- 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)set_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)
reminder bestie: if the tuner can't do the mode, -EINVAL is the whole answer β don't go looking for a cute little success message, it's not coming π
and that's the page!! brought to you straight out of ./drivers/media/v4l2-core, dated October 2026, check_mode(9) β slay, go read the rest of the kernel now, periodt π§ββοΈπ
π¦ 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