dtpm_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dtpm_register β€” NAME, bestie edition πŸ’–

okay so this page is from the Kernel API Manual, and it's literally all about dtpm_register β€” which registers a dtpm node in the hierarchy tree 🌳✨ yes, that's the whole vibe.


✨ SYNOPSIS ✨

int dtpm_register (const char *name , struct dtpm *dtpm , struct dtpm
*parent );

like, three args, one int back, no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • name β€” a string specifying the name of the node πŸ’…
  • dtpm β€” a pointer to a dtpm structure corresponding to the new node πŸ¦‹
  • parent β€” a pointer to a dtpm structure corresponding to the parent node 🌸

🌈 DESCRIPTION 🌈

So the whole point: you're creating a dtpm node in the tree 🌳

If no parent is specified, then the node is the root node of the hierarchy β€” main character energy, queen of the tree πŸ‘‘. But heads up: if the root node already exists, then the registration will fail. no takebacks, no duplicates πŸ™ˆ

Also, the powercap controller must be initialized before calling this function β€” like, do that first, fr fr ⚠️

And the dtpm structure must be initialized with the power numbers before calling this function. don't skip that step bestie 😭


πŸ”₯ RETURN πŸ”₯

zero on success πŸŽ‰ β€” and a negative value in case of error:

  • -EAGAIN β€” the function is called before the framework is initialized πŸ’€
  • -EBUSY β€” the root node is already inserted 🚫
  • -EINVAL β€”
    • there is no root node yet and parent is specified
    • no all ops are defined
    • parent have ops which are reserved for leaves

Other negative values are reported back from the powercap framework 🫢

ngl that -EINVAL list is giving "read it twice" energy β€” check your ops and your parent before you come crying to the kernel πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/powercap/dtpm.c

go read those next, iykyk πŸ“šβœ¨


and that's the page!! πŸŽ€ this one lives under ./drivers/powercap, dated October 2026 β€” mwah, go register some nodes responsibly bestie πŸ’–πŸŒ³πŸ«Ά

πŸ“¦ where this page comes from