cpufreq_state2power(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay bestie, this is cpufreq_state2power(9) from the Kernel API Manual, and it is literally here to convert a cpu cdev state to power consumed. πŸŽ€

🌸 SYNOPSIS 🌸

       int cpufreq_state2power (struct thermal_cooling_device *cdev , unsigned
       long state , u32 *power );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • cdev β€” thermal_cooling_device pointer.
  • state β€” cooling device state to be converted.
  • power β€” pointer in which to store the resulting power.

πŸ’– DESCRIPTION πŸ’–

So like, this function takes the cooling device state state and converts it into power consumption in milliwatts, assuming 100% load. Then it stores the calculated power in power. Slay, that’s the whole vibe. ✨

πŸ”₯ RETURN πŸ”₯

It returns 0 on success. If the cooling device state is bigger than maximum allowed, it returns -EINVAL β€” yes, bestie, that’s the error, don’t ignore it. πŸ’€

🌈 SEE ALSO 🌈

The kernel file is ./drivers/thermal/cpufreq_cooling.c, and the whole squad is:


This page’s source is ./drivers/thermal, dated October 2026, and it’s filed under cpufreq_state2power(9) β€” periodt, bestie πŸ’œ

πŸ“¦ where this page comes from