typec_port_register_altmode(9)
π typec_port_register_altmode(9) π
okay so bestie, welcome to the Kernel API Manual β yes, that's the manual name, and yes, you're gonna get through this, i promise π«Ά this one's all about registering an Alternate Mode on a USB Type-C port, and honestly? it's giving "small function, big responsibility." let's get into it β¨
πΈ NAME πΈ
typec_port_register_altmode β Register USB Type-C Port Alternate Mode π
like, it's literally the function that puts your alternate mode on the map. main character energy fr fr.
β¨ SYNOPSIS β¨
struct typec_altmode * typec_port_register_altmode (struct typec_port
*port , const struct typec_altmode_desc *desc );
look at that signature. gorgeous. no cap π
π¦ ARGUMENTS π¦
portβ the USB Type-C Port that supports the alternate mode. this is your homegirl right here β the port that's down to support the alt mode πdescβ the Description of the alternate mode. all the deets, packaged up in astruct typec_altmode_descπ
π DESCRIPTION π
okay so here's the tea π this routine is used to register an alternate mode that port is capable of supporting. that's it. that's the whole job. and it ate, honestly.
Returns a handle to the alternate mode on success, or ERR_PTR on failure π β so like, always check it, bestie, don't just raw-dog the return value, i'm begging you π
π SEE ALSO π
the lore is deep, so here's the whole friend group β plus the kernel file they all live in:
Kernel file ./drivers/usb/typec/class.c
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_plug_register_altmode(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_cable_ops(9)typec_register_port(9)typec_unregister_port(9)
like, that's a whole squad π go read them, iykyk π
that's the whole page, bestie β go forth and register those alternate modes π β¨
signing off from ./drivers/usb/typec, dated October 2026, this was typec_port_register_altmode(9) β mwah, ily, bye ππ
π¦ 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