__cpufreq_cooling_register(9)
π
__cpufreq_cooling_register(9) π
okay bestie, so this is a kernel API manual page, and we're gonna get into it β no cap, this whole thing lives in the Kernel API Manual and it's literally the blueprint for making a cpufreq cooling device. let's go π«Ά
β¨ NAME β¨
__cpufreq_cooling_register β it's the helper function to create a cpufreq cooling device π like, that's literally its whole job and it ate
β¨ SYNOPSIS β¨
struct thermal_cooling_device * __cpufreq_cooling_register (struct
device_node *np , struct cpufreq_policy *policy , struct em_perf_domain
*em );
that's the signature, don't touch it, she's iconic exactly as she is π
β¨ ARGUMENTS β¨
npβ a validstruct device_nodethat points to the cooling device tree node π³ like yes bestie we're linking into the DTpolicyβ the cpufreq policy. and ngl, normally this should be the same ascpufreq policy->related_cpusβ like that's the vibe check it needs to passemβ the Energy Model of the cpufreq policy β‘ it's giving power management realness
β¨ DESCRIPTION β¨
okay so here's the moment, the main character energy of this whole page: this interface function registers the cpufreq cooling device with the name "cpufreq-s" π
and the way this API is so generous β it can support multiple instances of cpufreq cooling devices, like she's not gatekeeping, periodt π
it also gives you the opportunity to link the cooling device with a device tree node, in order to bind it via the thermal DT code π¦ so yeah, that's the whole shebang and it's lowkey slay
β¨ RETURN β¨
on success you get a valid struct thermal_cooling_device pointer β chef's kiss π€ and on failure, it returns a corresponding ERR_PTR π so pls check that return value bestie, fr fr
β οΈ heads up: failure is not a vibe, it hands you back an ERR_PTR β always check!!
β¨ SEE ALSO β¨
okay so this is the little friendship circle, the whole crew π β first up, the kernel file ./drivers/thermal/cpufreq_cooling.c, then all these faves:
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_state2power(9)cpufreq_power2state(9)cpufreq_get_max_state(9)cpufreq_get_cur_state(9)cpufreq_set_cur_state(9)cpufreq_cooling_register(9)of_cpufreq_cooling_register(9)cpufreq_cooling_unregister(9)
like that's the whole group chat, go say hi π
and that's the page!! π¦ this whole thing lives in ./drivers/thermal, dated October 2026, and it's part of the Kernel API Manual β signed, sealed, delivered, slay β¨π
π
π¦ 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