typec_set_pwr_opmode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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