typec_match_altmode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… typec_match_altmode(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ β€” today's main character is typec_match_altmode, and she's filed under section 9 of the manual, literally. Let's get into it 🫢


πŸ¦‹ NAME πŸ¦‹

typec_match_altmode β€” match SVID and mode to an array of alternate modes πŸ’–

no cap, that's the whole vibe: you got a pile of alternate modes, you got an SVID and a mode, and you want to see who matches.


✨ SYNOPSIS ✨

struct typec_altmode * typec_match_altmode (struct typec_altmode
**altmodes , size_t n , u16 svid , u8 mode );

look at her go 😭 she takes a pointer-to-pointer, a size, a u16 and a u8, and hands you back a struct typec_altmode *. iconic.


πŸŽ€ ARGUMENTS πŸŽ€

  • altmodes β€” the array of alternate modes, bestie. it's the lineup πŸ‘‘
  • n β€” how many elements are in that array, or -1 for NULL terminated arrays 🌸 (yes, negative one as a size_t, that's just how she rolls, don't @ me)
  • svid β€” the Standard or Vendor ID you're matching with πŸ”
  • mode β€” the mode you're matching with ⭐

πŸ’œ DESCRIPTION πŸ’œ

she returns a pointer to an alternate mode with an SVID matching svid, or NULL when no match is found πŸ’€

that's it, that's the whole function. tiny, focused, main character energy β€” she knows what she's about 🧚

btw the docs say SVID matching β€” that's the promise being made here, iykyk πŸ‘€

🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/usb/typec/bus.c β€” go read her neighbors, they're all family 🫢 :


okay that's the whole page, go slay some Type-C matching πŸ’…βœ¨

sign-off time πŸŽ€ β€” this lil masterpiece comes from the source/version line ./drivers/usb/typec, dated October 2026, and answers to the name typec_match_altmode(9) πŸ¦‹πŸ’– periodt.

πŸ“¦ where this page comes from