typec_plug_register_altmode(9)
π typec_plug_register_altmode β like, the Kernel API Manual page, bestie β¨
okay so picture this: you're deep in the USB Type-C trenches, and this little function is the one that gets your cable plug's alternate modes officially on the guest list. no cap, it's giving backstage-pass energy π
πΈ SYNOPSIS πΈ
struct typec_altmode * typec_plug_register_altmode (struct typec_plug
*plug , const struct typec_altmode_desc *desc );
π«Ά ARGUMENTS π«Ά
plugβ the USB Type-C Cable Plug that supports the alternate mode. yeah, that one. the plug in question πdescβ the description of the alternate mode. literally the whole vibe of the mode, written down β¨
π₯ DESCRIPTION π₯
okay so here's the tea: this routine is what you call to register each alternate mode individually β one at a time, no bundling β that plug has listed in response to the Discover SVIDs command. iconic behavior, honestly π
and listen, this part matters: the modes for a SVID that the plug lists in response to the Discover Modes command need to be listed in an array in desc. not scattered, not vibes-based β an actual array. iykyk π§
on success you get back a handle to the alternate mode. on failure? ERR_PTR. not great, not terrible, just how it is π
bestie please check that return value, ERR_PTR is not a mood you wanna ignore π
π SEE ALSO π
Kernel file ./drivers/usb/typec/class.c β and the whole extended friend group:
typec_altmode_update_active(9)typec_altmode2port(9)typec_altmode_set_ops(9)typec_unregister_altmode(9)typec_partner_set_usb_mode(9)typec_partner_set_identity(9)typec_partner_set_pd_revision(9)typec_partner_set_usb_power_delivery(9)typec_partner_set_num_altmodes(9)typec_partner_register_altmode(9)typec_partner_set_svdm_version(9)typec_partner_usb_power_delivery_register(9)typec_register_partner(9)typec_unregister_partner(9)typec_plug_set_num_altmodes(9)typec_register_plug(9)typec_unregister_plug(9)typec_cable_get(9)typec_cable_put(9)typec_cable_is_active(9)typec_cable_altmode_unsupported(9)typec_cable_set_identity(9)typec_register_cable(9)typec_unregister_cable(9)typec_port_set_usb_mode(9)typec_port_set_usb_power_delivery(9)typec_set_data_role(9)typec_get_data_role(9)typec_set_pwr_role(9)typec_set_vconn_role(9)typec_set_pwr_opmode(9)typec_find_pwr_opmode(9)typec_find_orientation(9)typec_find_port_power_role(9)typec_find_power_role(9)typec_find_port_data_role(9)typec_set_orientation(9)typec_get_orientation(9)typec_set_mode(9)typec_get_negotiated_svdm_version(9)typec_get_cable_svdm_version(9)typec_cable_set_svdm_version(9)typec_get_drvdata(9)typec_port_register_altmode(9)typec_port_register_cable_ops(9)typec_register_port(9)typec_unregister_port(9)
and that's the whole page, bestie π«Ά brought to you by ./drivers/usb/typec, dated October 2026, and yeah β it's a <rainbow>typec_plug_register_altmode(9)</rainbow> situation from start to finish. slay π
β¨
π¦ 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