thermal_of_c...ice_register(9)
π thermal_of_c...ice_register(9) β Kernel API Manual π
okay bestie, so we're in the Kernel API Manual today and this one is all about the thermal_of_cooling_device_register function. yes it's a mouthful, yes it's iconic, let's get into it π«Ά
β¨ NAME β¨
thermal_of_cooling_device_register β register an OF thermal cooling device. that's the whole vibe. she registers, she cools, she does it with a device tree node. periodt. π
πΈ SYNOPSIS πΈ
struct thermal_cooling_device * thermal_of_cooling_device_register
(struct device_node *np , u32 cdev_id , const char *type , void *devdata
, const struct thermal_cooling_device_ops *ops );
look at her. long signature, main character energy, not a single wasted character. π
π ARGUMENTS π
npβ a pointer to a device tree node. just a lil pointer, no big deal, but she's the one who makes the whole device-tree binding thing happen β¨cdev_idβ a cooling device id in the cooling controller. it's au32, it's the id, she's keeping track π¦typeβ the thermal cooling device type.const char *, so likeβ¦ be normal about it please πdevdataβ device private data.void *, so it can literally be anything, iykyk πopsβ standard thermal cooling devices callbacks. it's aconst struct thermal_cooling_device_ops *and yes you actually need to fill it in π
π₯ DESCRIPTION π₯
so here's the tea β β this interface function adds a new thermal cooling device (fan/processor/...) to the /sys/class/thermal/ folder as cooling_device[0-*]. yes, that's a glob, she's flexible like that.
the way that it also tries to bind itself to all the thermal zone devices registered at the same time?? obsessed. π
and it gives you the opportunity to link the cooling device to a device tree node, so that it can be bound to a thermal zone created out of device tree. that's literally the whole point, no cap. πΈ
π RETURN π
it returns a pointer to the created struct thermal_cooling_device or an ERR_PTR.
bestie please, this part matters: the caller must check the return value with the IS_ERR*() helpers. do NOT skip the vibe check. π
π§ SEE ALSO π§
- Kernel file
./drivers/thermal/thermal_of.c thermal_of_get_trip_type(9)thermal_of_zone_unregister(9)thermal_of_zone_register(9)devm_thermal_of_zone_register(9)devm_thermal_of_zone_unregister(9)devm_thermal_of_cooling_device_register(9)devm_thermal_of_child_cooling_device_register(9)
like a whole little friend group of thermal functions, and honestly? they all ate. π₯
aaaand that's the page!! π brought to you by ./drivers/thermal, dated October 2026, still titled thermal_of_c...ice_register(9) because the header truncation is part of the aesthetic now. slay, go register your cooling device 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