cpufreq_state2power(9)
β¨ 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:
struct time_in_idle(9)struct cpufreq_cooling_device(9)get_level(9)get_load(9)get_dynamic_power(9)cpufreq_get_requested_power(9)cpufreq_power2state(9)cpufreq_get_max_state(9)cpufreq_get_cur_state(9)cpufreq_set_cur_state(9)__cpufreq_cooling_register(9)cpufreq_cooling_register(9)of_cpufreq_cooling_register(9)cpufreq_cooling_unregister(9)
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
- 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