STRUCT DEVFREQ_COOLING_POWER(9)
π NAME π
ok so struct devfreq_cooling_power β it's the Devfreq cooling power ops struct, bestie. that's the whole vibe. it's literally the little bundle of callbacks that lets a devfreq device tell the thermal framework how much power it's actually sipping π
β¨ SYNOPSIS β¨
struct devfreq_cooling_power {
int (*get_real_power)(struct devfreq *df, u32 *power, unsigned long
freq, unsigned long voltage);
};
like, one member. one. and it's the main character tbh π
π«Ά Members π«Ά
get_real_powerβ okay so when this bad boy is set, the framework uses it to go ask the device driver for the actual power. no cap. some devices have way more sophisticated methods (think power counters β¨) to approximate the real power they're using, and this function is how they hand that more accurate data over to the thermal governor. when the driver doesn't provide such a function, the framework just uses the pre-calculated table and scales the power by'utilization'β that's based on'busy_time'and'total_time'grabbed from devfreq'last_status'. iykyk π
hiii quick heads up π the value returned by this function must be lower or equal than the maximum power value for the current state (you can find that in power_table[state]). no exceptions, bestie, that's a hard rule.
and when this interface is used, the power_table holds the max total (static + dynamic) power value for each OPP. static and dynamic. both. periodt π₯
πΈ SEE ALSO πΈ
- Kernel file
./include/linux/devfreq_cooling.hβ go read it, it's giving source-of-truth energy π
ok that's the whole page, you ate that π and just so we're keeping receipts: this was living in ./include/linux, dated October 2026, and it's part of the Kernel API Manual π mwah, go touch some OPPs π
π¦ 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