typec_plug_set_num_altmodes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… typec_plug_set_num_altmodes(9) β€” the Kernel API Manual glow-up πŸŽ€

okay so bestie, welcome to the typec_plug_set_num_altmodes page from the Kernel API Manual ✨ grab a boba, because we're about to tell the kernel how many alternate modes a plug has, and honestly? it's giving "small function, big responsibility" πŸ’–


✨ NAME ✨

typec_plug_set_num_altmodes β€” literally just sets the number of available plug altmodes πŸ¦‹


🌸 SYNOPSIS 🌸

int typec_plug_set_num_altmodes (struct typec_plug *plug , int
       num_altmodes );

bestie it returns an int, it takes a struct typec_plug * and an int, and it's exactly as iconic as it looks πŸ’…


🫢 ARGUMENTS 🫢

  • plug β€” the plug we're updating. the main character plug, if you will πŸ‘‘
  • num_altmodes β€” the number of altmodes we want to specify as available. yes, we choose the number. we hold the power πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

so this routine is what you use to report the number of alternate modes supported by the plug. lowkey important detail though: this value is *not* enforced in alternate mode registration routines. like, it's a report, not a bouncer at the club πŸ’€ read that asterisk-star emphasis again, because the original is doing the most to make sure you noticed.

plug.num_altmodes is set to -1 on plug registration, denoting that a valid value has not been set for it yet. so if you see a -1 sitting there, that's the "no thoughts, head empty, value not set yet" state πŸ™ˆ

Returns 0 on success or negative error number on failure. classic. slay when it's 0, sad girl hours when it's negative 😭

no cap: the -1 at plug registration is a denoting situation, meaning "not set yet" β€” it's not a real altmode count. don't be out here counting it as one πŸŽ€

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group showed up for this one, so here's everybody β€” same names, same (9), no substitutions πŸ’–

also hanging out in the Kernel file ./drivers/usb/typec/class.c 🧚


🌈 sign-off 🌈

that's the whole page, bestie, and you ate it up πŸ‘‘ this little gem lives in ./drivers/usb/typec, dated October 2026, and it's giving "kernel docs but make it cute" πŸ’–βœ¨πŸŽ€ go forth and set those altmode numbers, periodt πŸ¦‹

πŸ“¦ where this page comes from