STRUCT POWERCAP_CONTROL_TYPE_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct powercap_control_type_ops(9)

okay so bestie, welcome to the Kernel API Manual β€” this is the page for struct powercap_control_type_ops, and it's basically the vibe contract your driver signs when it wants to be a powercap control type. it's giving "define your callbacks or perish" ✨


🌸 NAME 🌸

struct powercap_control_type_ops β€” literally the place where you define your control type callbacks, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct powercap_control_type_ops {
    int (*set_enable) (struct powercap_control_type *, bool mode);
    int (*get_enable) (struct powercap_control_type *, bool *mode);
    int (*release) (struct powercap_control_type *);
 };

look at her. three function pointers. main character energy πŸ’…


πŸ‘‘ MEMBERS πŸ‘‘

  • set_enable β€” turns the whole control type on or off. the default is enabled, but this callback is what lets all the zones slide into a disabled state and yeet any applied power limits. lowkey important: if it's disabled, a power zone can only be monitored, not controlled. so like, watching from the sidelines only πŸ™ˆ
  • get_enable β€” just gets the current Enable/Disable status. the vibe check of callbacks πŸ’–
  • release β€” a callback that tells you the last reference to this control type is closed. so at that point it's totally safe to free the data structure associated with this control type 🫢 this callback is mandatory if the client owns the memory for the control type β€” like, not optional, fr fr.

✨ DESCRIPTION ✨

this structure is where you define the control type callbacks that client drivers have to implement. that's the whole gig. she's a contract, she's a blueprint, she's iconic πŸ’œ


🌈 SEE ALSO 🌈

kernel file ./include/linux/powercap.h, plus the whole powercap friend group:


ngl if you're implementing a powercap control type, read the whole squad above before you touch anything. iykyk 😭πŸ”₯

okay that's the whole page, mwah πŸ’‹ this little beauty lives in ./include/linux and was dated October 2026 β€” so yeah, future-coded and still slaying πŸ“πŸ§šβ­

πŸ“¦ where this page comes from