typec_set_pwr_opmode(9)
π typec_set_pwr_opmode π
okok so this is straight out of the Kernel API Manual, section 9, and bestie it is such a cute tiny function. one job, does it well, no notes. let's get into it π«Ά
β¨ NAME β¨
typec_set_pwr_opmode β literally just "hey, the power operation mode changed, thought u should know" π
πΈ SYNOPSIS πΈ
void typec_set_pwr_opmode (struct typec_port *port , enum
typec_pwr_opmode opmode );
ngl she's a void. returns nothing. gives everything. π
π ARGUMENTS π
portβ the USB Type-C Port where the mode was changed. the actual main character of the situation πopmodeβ the new power operation mode. the fresh vibe the port is serving β¨
π¦ DESCRIPTION π¦
okay so this routine is the one port drivers call when they need to report that the power operation mode in the port has changed. that's it. that's the whole arc. and honestly? iconic. π
the modes you can report are:
- USB β the default one, no cap π
1.5Aβ as defined in the USB Type-C specification β3.0Aβ also as defined in the USB Type-C specification π₯- "USB Power Delivery" β this is the one for when the power levels are negotiated with the methods defined in the USB Power Delivery specification π§
so like. USB, 1.5A, 3.0A, or the fancy negotiated-PD one. pick ur fighter, tell the port, done. π
no cap: those are the only modes this thing knows about. don't go inventing new ones, bestie. π
π SEE ALSO π
the whole friend group lives in the kernel file ./drivers/usb/typec/class.c β go say hi to all of them:
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_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β¦ a whole extended universe fr fr. iykyk π¦β¨
okay that's the page!! this one's brought to you by the good people over in ./drivers/usb/typec, dated October 2026 π go forth and report ur power modes correctly bestie, 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