STRUCT POWERCAP_ZONE_OPS(9)
π
struct powercap_zone_ops(9) β Kernel API Manual π
okay bestie, welcome to the Kernel API Manual page for struct powercap_zone_ops β the callback blueprint for a power zone, and yes, itβs kind of iconic. π
πΈ NAME πΈ
struct powercap_zone_ops β Define power zone callbacks. Thatβs the whole assignment, no cap. β¨
β¨ SYNOPSIS β¨
struct powercap_zone_ops {
int (*get_max_energy_range_uj) (struct powercap_zone *, u64 *);
int (*get_energy_uj) (struct powercap_zone *, u64 *);
int (*reset_energy_uj) (struct powercap_zone *);
int (*get_max_power_range_uw) (struct powercap_zone *, u64 *);
int (*get_power_uw) (struct powercap_zone *, u64 *);
int (*set_enable) (struct powercap_zone *, bool mode);
int (*get_enable) (struct powercap_zone *, bool *mode);
int (*release) (struct powercap_zone *);
};
π Members π
get_max_energy_range_ujβ gets the maximum range of the energy counter in micro-joules. πget_energy_ujβ gets the current energy counter in micro-joules. β‘reset_energy_ujβ resets the micro-joules energy counter. πget_max_power_range_uwβ gets the maximum range of the power counter in micro-watts. π₯get_power_uwβ gets the current power counter in micro-watts. πset_enableβ enables/disables power zone controls. Default is enabled. ποΈget_enableβ gets the Enable/Disable status. πreleaseβ callback to inform that the last reference to this control type is closed. So it is safe to free the data structure associated with this control type. Mandatory, if the client driver owns thepower_zonememory. ποΈ
π«Ά Description π«Ά
This structure defines zone callbacks to be implemented by client drivers. Client drives can define both energy and power related callbacks. But at the least one type (either power or energy) is mandatory. Client drivers should handle mutual exclusion, if required in callbacks. πβ¨
π SEE ALSO π
- Kernel file
./include/linux/powercap.hstruct powercap_control_type_ops(9)struct powercap_control_type(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)
Source/version sticker: ./include/linux Β· Date sticker: October 2026 β thatβs the footer vibe, bestie, and it ate π
β¨π«Ά
π¦ 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