STRUCT POWERCAP_ZONE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct powercap_zone(9) β€” Kernel API Manual, but make it cute

okay so real talk: we're looking at struct powercap_zone(9) from the Kernel API Manual, and bestie, it's giving "the blueprint of a power cap zone." Let's get into it πŸ’–


✨ NAME ✨

struct powercap_zone β€” literally defines an instance of a power cap zone. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

struct powercap_zone {
    int id;
    char *name;
    void *control_type_inst;
    const struct powercap_zone_ops *ops;
    struct device dev;
    int const_id_cnt;
    struct idr idr;
    struct idr *parent_idr;
    void *private_data;
    struct attribute **zone_dev_attrs;
    int zone_attr_count;
    struct attribute_group dev_zone_attr_group;
    const struct attribute_group *dev_attr_groups[2];
    bool allocated;
    struct powercap_zone_constraint *constraints;
 };

like, look at her. fifteen fields and every single one is doing its job. no filler, no fluff, main character struct energy fr fr πŸ‘‘


πŸ¦‹ Members πŸ¦‹

  • id β€” the unique id. one of a kind, obviously. ✨
  • name β€” the power zone name. her government name, if you will. πŸŽ€
  • control_type_inst β€” the control type instance for this zone. yes it's a void *, yes we're being mysterious about it πŸ’…
  • ops β€” pointer to the zone operation structure. the whole personality lives here tbh.
  • dev β€” an instance of a device. she has a device. we love that for her.
  • const_id_cnt β€” number of constraints defined. count 'em, bestie πŸ”₯
  • idr β€” an instance of an idr entry, but specifically for children zones. it's giving "mom of the group chat" 🫢
  • parent_idr β€” used to remove the reference from the parent idr. gotta clean up after yourself, no cap.
  • private_data β€” private data pointer, if any, for this zone. if any. respect the mystery πŸ™ˆ
  • zone_dev_attrs β€” the attributes associated with this device.
  • zone_attr_count β€” the attribute count. because somebody has to keep track 😭
  • dev_zone_attr_group β€” the attribute group for attributes. groups within groups, iconic.
  • dev_attr_groups β€” the attribute group store that gets registered with the device.
  • allocated β€” okay so this one's a whole situation: it's possible that the client owns the memory used by this structure. in that case, this flag is set to false by the framework to prevent deallocation during the release process. otherwise, this flag is set to true. read it twice, bestie, this is the important one ⭐
  • constraints β€” the list of constraints for this zone. the rules. the boundaries. the "no ❀️" energy.

πŸ’œ Description πŸ’œ

so basically: this defines a power zone instance. and now the part where I hold your hand and look you dead in the eye β€” the fields of this structure are private, and should not be used by client drivers. πŸ”’

fr fr do NOT go poking at these fields from your driver. they're private. it's not your business. iykyk πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

like a little friend group of man pages. go read them all, they're all slay πŸ¦‹


that's the whole page, bestie! this cutie lives in ./include/linux and the version/date on it is October 2026, filed under struct powercap_zone(9) β€” mwah, go forth and don't touch the private fields πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from