check_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 internal struct_tuner. yep, the whole struct, hand it over 🫢
  • mode β€” the mode of the tuner, as defined by enum 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 🌈


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