STRUCT POWERCAP_ZONE_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the power_zone memory. πŸ—‘οΈ

🫢 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 πŸ‘‘


Source/version sticker: ./include/linux Β· Date sticker: October 2026 β€” that’s the footer vibe, bestie, and it ate πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from