typec_register_plug(9)
π typec_register_plug(9) β like, the Kernel API Manual page, bestie
okay so picture this: it's the Linux kernel, it's the Kernel API Manual, and the function we're obsessing over today is typec_register_plug(9). yes that's a 9 in the parens, that means kernel API, we don't make the rules π
β¨ NAME β¨
typec_register_plug β register a USB Type-C Cable Plug. that's it, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
struct typec_plug * typec_register_plug (struct typec_cable *cable ,
struct typec_plug_desc *desc );
two arguments, one cute little struct pointer coming back at you. slay. π
π ARGUMENTS π
cableβ the USB Type-C Cable that's got the plug on it. like, the plug's home cable, its main character context, yk?descβ the description of the cable plug. this is where you tell everyone what this plug actually is. β¨
π DESCRIPTION π
so this is the whole point of the page: typec_register_plug registers a device for the USB Type-C Cable Plug that's described in desc. π«Ά
now, a USB Type-C Cable Plug represents a plug with electronics in it that can respond to USB Power Delivery SOP Prime or SOP Double Prime packages. like β it's not just a dumb chunk of metal, it's got chips, it's got opinions, it's got SOP Prime and SOP Double Prime energy going on. iykyk. β‘
on success you get a handle to the cable plug back. on failure you get an ERR_PTR. which is the kernel way of being like "no π". check that thing, fr fr.
π SEE ALSO π
the reading list. the whole extended universe. grab a snack, this is a long one π
- 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_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)
like i said. extended universe. π₯
and that's the page!! π§ this little beauty lives over in ./drivers/usb/typec, it's dated October 2026, and yeah β it's typec_register_plug(9), we've been through this π go register a plug, you absolute icon. mwah. ππ«Ά
π¦ 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