typec_match_altmode(9)
π 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-1for NULL terminated arrays πΈ (yes, negative one as asize_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 π«Ά :
typec_altmode_notify(9)typec_altmode_enter(9)typec_altmode_exit(9)typec_altmode_attention(9)typec_altmode_vdm(9)typec_cable_altmode_enter(9)typec_cable_altmode_exit(9)typec_cable_altmode_vdm(9)typec_altmode_get_plug(9)typec_altmode_put_plug(9)
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
- 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