STRUCT POWERCAP_CONTROL_TYPE_OPS(9)
π 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:
struct powercap_control_type(9)struct powercap_zone_ops(9)struct powercap_zone(9)struct powercap_zone_constraint_ops(9)struct powercap_zone_constraint(9)powercap_set_zone_data(9)powercap_get_zone_data(9)powercap_register_control_type(9)powercap_unregister_control_type(9)powercap_register_zone(9)powercap_unregister_zone(9)
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
- 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