set_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 internal struct_tuner. like, the tuner's whole self. its main character data structure πŸ’–
  • mode β€” an enum 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:

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