thermal_zon...r_with_trips(9)
๐ thermal_zone_device_register_with_trips โ the Kernel API Manual, bestie edition โจ
okay so this is a page from the Kernel API Manual and it's literally about registering a whole new thermal zone device. it's giving "i make sensors appear out of thin air" energy and honestly? iconic. let's get into it ๐ซถ
๐ธ NAME ๐ธ
thermal_zone_device_register_with_trips โ register a new thermal zone device
like, that's the whole job. you call it, a thermal zone device exists. main character behaviour fr fr ๐ฅ
โจ SYNOPSIS โจ
struct thermal_zone_device * thermal_zone_device_register_with_trips
(const char *type , const struct thermal_trip *trips , int num_trips ,
void *devdata , const struct thermal_zone_device_ops *ops , const struct
thermal_zone_params *tzp , unsigned int passive_delay , unsigned int
polling_delay );
it returns a struct thermal_zone_device * and takes eight (8!) arguments. yes eight. she's high maintenance and she's worth it ๐
๐ ARGUMENTS ๐
typeโ the thermal zone device type. basically her name tag at the party ๐ท๏ธtripsโ a pointer to an array of thermal trips. the whole itinerary, bestie โ๏ธnum_tripsโ the number of trip points the thermal zone support. (not me counting them for you โ well, kind of, that's literally this arg ๐งฎ)devdataโ private device data. her little diary that only she reads ๐opsโ standard thermal zone device callbacks. the functions she calls when things go down ๐tzpโ thermal zone platform parameters. the settings sheet ๐๏ธpassive_delayโ number of milliseconds to wait between polls when performing passive cooling. no cap, that's the actual unit โณpolling_delayโ number of milliseconds to wait between polls when checking whether trip points have been crossed (0for interrupt driven systems). zero means "don't poll me, i'll ping you" โก
๐ DESCRIPTION ๐
okay so here's the vibe: this interface function adds a new thermal zone device (sensor) to the /sys/class/thermal folder as thermal_zone[0-*]. she moves in, picks her room, puts up posters. โจ
it tries to bind all the thermal cooling devices registered at the same time. like, matching besties at orientation, except it's cooling devices ๐ซถ
โ ๏ธ real talk: thermal_zone_device_unregister must be called when the device is no longer needed. you cannot just ghost her, that's not how this works ๐ญ
and the passive cooling depends on the .get_trend return value. periodt ๐
๐ RETURN ๐
returns a pointer to the created struct thermal_zone_device or, in case of error, an ERR_PTR. caller must check return value with IS_ERR*() helpers.
so like โ bestie โ please actually check it. don't just assume it worked. use your IS_ERR*() helpers, that's what they're for ๐ง๐
๐ SEE ALSO ๐
- Kernel file
./drivers/thermal/thermal_core.cbind_previous_governor(9) thermal_set_governor(9)thermal_bind_cdev_to_trip(9)thermal_unbind_cdev_from_trip(9)thermal_cooling_device_register(9)devm_thermal_cooling_device_register(9)thermal_cooling_device_update(9)thermal_cooling_device_unregister(9)thermal_zone_device_unregister(9)thermal_zone_get_zone_by_name(9)
go read the whole friend group, they're all linked for a reason ๐๐ธ
and that's the page!! this little gem lives in ./drivers/thermal and it's dated October 2026 โ yes, the future, because thermal zones stay booked and busy ๐โจ mwah, study up and slay your driver bring-up 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