dtpm_register(9)
π 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 adtpmstructure corresponding to the new node π¦parentβ a pointer to adtpmstructure 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
parentis specified - no all ops are defined
parenthave ops which are reserved for leaves
- there is no root node yet and
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
- 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