typec_altmode_get_plug(9)
π typec_altmode_get_plug(9) β the Kernel API Manual page, bestie edition π
okay so this is a page from the Kernel API Manual (manual section 9, the kernel-functions one, iykyk) and it's all about typec_altmode_get_plug. literally the whole personality of this function is "find the cable plug alternate mode" and honestly? slay.
β¨ NAME β¨
typec_altmode_get_plug β find the cable plug alternate mode π
π¦ SYNOPSIS π¦
struct typec_altmode * typec_altmode_get_plug (struct typec_altmode
*adev , enum typec_plug_index index );
like yes that's the whole signature, no cap, it's giving "one function, two arguments, zero drama" π
πΈ ARGUMENTS πΈ
adevβ handle to the partner alternate mode. that's your entry point, bestie π«Άindexβ the cable plug index. which plug we talking about? this tells it β¨
π DESCRIPTION π
so what this does: it increments the reference count for the cable plug alternate mode device. yes, the refcount. we love a responsible reference count π
then it returns a handle to the cable plug alternate mode β or NULL if none is found. that's it! NULL means none, no vibes to be found, empty group chat π
ngl, always vibe check that return value before you dereference it. NULL is a real possible answer here, fr fr.
π SEE ALSO π
the kernel file ./drivers/usb/typec/bus.c lives over there and it's iconic, plus these besties:
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_put_plug(9)typec_match_altmode(9)
not me listing all of them, but also... yes, all of them, periodt. go read the whole friend group πΈ
okay and one last cute sign-off π β this page comes from ./drivers/usb/typec, and the version/date stamped on it is October 2026, and the title repping it at the bottom is typec_altmode_get_plug(9). that's the whole footer, bestie, we ate πβ¨
π¦ 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