Lines Matching +full:thermal +full:- +full:sensor
1 Generic Thermal Sysfs driver How To
13 The generic thermal sysfs provides a set of interfaces for thermal zone
14 devices (sensors) and thermal cooling devices (fan, processor...) to register
15 with the thermal management solution and to be a part of it.
17 This how-to focuses on enabling new thermal zone and cooling devices to
18 participate in thermal management.
19 This solution is platform independent and any type of thermal zone devices
22 The main task of the thermal sysfs driver is to expose thermal zone attributes
24 An intelligent thermal management application can make decisions based on
25 inputs from thermal zone attributes (the current temperature and trip point
28 [0-*] denotes any positive number starting from 0
29 [1-*] denotes any positive number starting from 1
31 1. thermal sysfs driver interface functions
33 1.1 thermal zone device interface
40 This interface function adds a new thermal zone device (sensor) to
41 /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
42 thermal cooling devices registered at the same time.
44 type: the thermal zone type.
45 trips: the total number of trip points this thermal zone supports.
48 ops: thermal zone device call-backs.
49 .bind: bind the thermal zone device with a thermal cooling device.
50 .unbind: unbind the thermal zone device with a thermal cooling device.
51 .get_temp: get the current temperature of the thermal zone.
55 .get_mode: get the current mode (enabled/disabled) of the thermal zone.
56 - "enabled" means the kernel thermal management is enabled.
57 - "disabled" will prevent kernel thermal driver action upon trip points
58 so that user applications can take charge of thermal management.
59 .set_mode: set the mode (enabled/disabled) of the thermal zone.
65 tzp: thermal zone platform parameters.
74 This interface function removes the thermal zone device.
75 It deletes the corresponding entry from /sys/class/thermal folder and
76 unbinds all the thermal cooling devices it uses.
82 This interface adds a new sensor to a DT thermal zone.
83 This function will search the list of thermal zones described in
84 device tree and look for the zone that refer to the sensor device
85 pointed by dev->of_node as temperature providers. For the zone
86 pointing to the sensor node, the sensor will be added to the DT
87 thermal zone device.
90 dev: Device node of sensor containing valid node pointer in
91 dev->of_node.
92 sensor_id: a sensor identifier, in case the sensor IP has more
99 sensor temperature. This is mandatory
100 callback provided by sensor driver.
103 left the driver must inform the thermal
106 sensor temperature trend.
108 sensor emulated temperature.
109 The thermal zone temperature is provided by the get_temp() function
113 It returns error pointer if fails otherwise valid thermal zone device
120 This interface unregisters a sensor from a DT thermal zone which was
122 This function removes the sensor callbacks and private data from the
123 thermal zone device registered with thermal_zone_of_sensor_register()
125 get_trend() thermal zone device callbacks.
135 The benefit of using this interface to register sensor is that it
153 for the thermal zone device, which might be useful for platform
159 for the thermal zone device, which might be useful for platform
162 1.2 thermal cooling device interface
166 This interface function adds a new thermal cooling device (fan/processor/...)
167 to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
168 to all the thermal zone devices registered at the same time.
171 ops: thermal cooling devices call-backs.
178 This interface function removes the thermal cooling device.
179 It deletes the corresponding entry from /sys/class/thermal folder and
180 unbinds itself from all the thermal zone devices using it.
182 1.3 interface for binding a thermal zone device with a thermal cooling device
187 This interface function binds a thermal cooling device to a particular trip
188 point of a thermal zone device.
189 This function is usually called in the thermal zone device .bind callback.
190 tz: the thermal zone device
191 cdev: thermal cooling device
192 trip: indicates which trip point in this thermal zone the cooling device
200 weight: the influence of this cooling device in this thermal
206 This interface function unbinds a thermal cooling device from a particular
207 trip point of a thermal zone device. This function is usually called in
208 the thermal zone device .unbind callback.
209 tz: the thermal zone device
210 cdev: thermal cooling device
211 trip: indicates which trip point in this thermal zone the cooling device
214 1.4 Thermal Zone Parameters
229 this thermal zone and cdev, for a particular trip point.
230 If nth bit is set, then the cdev and thermal zone are bound
234 array consisting of tuples <lower-state upper-state> of
242 This structure defines the platform level parameters for a thermal zone.
243 This data, for each thermal zone should come from the platform layer.
246 .governor_name: Name of the thermal governor used for this zone
247 .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs interface
261 Thermal sysfs attributes will be represented under /sys/class/thermal.
265 Thermal zone device sys I/F, created once it's registered:
266 /sys/class/thermal/thermal_zone[0-*]:
267 |---type: Type of the thermal zone
268 |---temp: Current temperature
269 |---mode: Working mode of the thermal zone
270 |---policy: Thermal governor used for this zone
271 |---available_policies: Available thermal governors for this zone
272 |---trip_point_[0-*]_temp: Trip point temperature
273 |---trip_point_[0-*]_type: Trip point type
274 |---trip_point_[0-*]_hyst: Hysteresis value for this trip point
275 |---emul_temp: Emulated temperature set node
276 |---sustainable_power: Sustainable dissipatable power
277 |---k_po: Proportional term during temperature overshoot
278 |---k_pu: Proportional term during temperature undershoot
279 |---k_i: PID's integral term in the power allocator gov
280 |---k_d: PID's derivative term in the power allocator
281 |---integral_cutoff: Offset above which errors are accumulated
282 |---slope: Slope constant applied as linear extrapolation
283 |---offset: Offset constant applied as linear extrapolation
285 Thermal cooling device sys I/F, created once it's registered:
286 /sys/class/thermal/cooling_device[0-*]:
287 |---type: Type of the cooling device(processor/fan/...)
288 |---max_state: Maximum cooling state of the cooling device
289 |---cur_state: Current cooling state of the cooling device
290 |---stats: Directory containing cooling device's statistics
291 |---stats/reset: Writing any value resets the statistics
292 |---stats/time_in_state_ms: Time (msec) spent in various cooling states
293 |---stats/total_trans: Total number of times cooling state is changed
294 |---stats/trans_table: Cooing state transition table
298 the relationship between a thermal zone and its associated cooling device.
302 /sys/class/thermal/thermal_zone[0-*]:
303 |---cdev[0-*]: [0-*]th cooling device in current thermal zone
304 |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
305 |---cdev[0-*]_weight: Influence of the cooling device in
306 this thermal zone
308 Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
309 the generic thermal driver also creates a hwmon sysfs I/F for each _type_
310 of thermal zone device. E.g. the generic thermal driver registers one hwmon
312 ACPI thermal zones.
314 /sys/class/hwmon/hwmon[0-*]:
315 |---name: The type of the thermal zone devices
316 |---temp[1-*]_input: The current temperature of thermal zone [1-*]
317 |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]
319 Please read Documentation/hwmon/sysfs-interface for additional information.
322 * Thermal zone attributes *
326 Strings which represent the thermal zone type.
327 This is given by thermal zone driver as part of registration.
328 E.g: "acpitz" indicates it's an ACPI thermal device.
334 Current temperature as reported by thermal zone (sensor).
341 managing the thermal zone. It can be either default kernel based
343 enabled = enable Kernel Thermal management.
344 disabled = Preventing kernel thermal zone driver actions upon
346 charge of the thermal management.
350 One of the various thermal governors used for a particular zone.
354 Available thermal governors which can be used for a particular zone.
357 trip_point_[0-*]_temp
362 trip_point_[0-*]_type
364 E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
365 thermal zone.
368 trip_point_[0-*]_hyst
373 cdev[0-*]
374 Sysfs link to the thermal cooling device node where the sys I/F
378 cdev[0-*]_trip_point
379 The trip point in this thermal zone which cdev[0-*] is associated
380 with; -1 means the cooling device is not associated with any trip
384 cdev[0-*]_weight
385 The influence of cdev[0-*] in this thermal zone. This value
386 is relative to the rest of cooling devices in the thermal
389 thermal zone.
394 policy is not supported by native thermal driver. Default is zero
403 Interface to set the emulated temperature method in thermal zone
404 (sensor). After setting this temperature, the thermal zone may pass
413 because userland can easily disable the thermal policy by simply
418 the thermal zone. Used by the power allocator governor. For
419 more information see Documentation/thermal/power_allocator.txt
428 Documentation/thermal/power_allocator.txt
436 Documentation/thermal/power_allocator.txt
443 Documentation/thermal/power_allocator.txt
449 Documentation/thermal/power_allocator.txt
459 Documentation/thermal/power_allocator.txt
465 to determine a hotspot temperature based off the sensor's
472 to determine a hotspot temperature based off the sensor's
483 - for generic ACPI: should be "Fan", "Processor" or "LCD"
484 - for memory controller device on intel_menlow platform:
495 - cur_state == 0 means no cooling
496 - cur_state == max_state means the maximum cooling.
521 reading this will return an -EFBIG error.
526 ACPI thermal zone may support multiple trip points like critical, hot,
527 passive, active. If an ACPI thermal zone supports critical, passive,
532 effectiveness in cooling the thermal zone.
537 /sys/class/thermal:
540 |---type: acpitz
541 |---temp: 37000
542 |---mode: enabled
543 |---policy: step_wise
544 |---available_policies: step_wise fair_share
545 |---trip_point_0_temp: 100000
546 |---trip_point_0_type: critical
547 |---trip_point_1_temp: 80000
548 |---trip_point_1_type: passive
549 |---trip_point_2_temp: 70000
550 |---trip_point_2_type: active0
551 |---trip_point_3_temp: 60000
552 |---trip_point_3_type: active1
553 |---cdev0: --->/sys/class/thermal/cooling_device0
554 |---cdev0_trip_point: 1 /* cdev0 can be used for passive */
555 |---cdev0_weight: 1024
556 |---cdev1: --->/sys/class/thermal/cooling_device3
557 |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/
558 |---cdev1_weight: 1024
561 |---type: Processor
562 |---max_state: 8
563 |---cur_state: 0
566 |---type: Fan
567 |---max_state: 2
568 |---cur_state: 0
573 |---name: acpitz
574 |---temp1_input: 37000
575 |---temp1_crit: 100000
585 thermal zone device will be used in the message to identify the zone. The
593 This function returns the trend of a thermal zone, i.e the rate of change
594 of temperature of the thermal zone. Ideally, the thermal sensor drivers
595 are supposed to implement the callback. If they don't, the thermal
605 This function handles the trip events from sensor drivers. It starts
619 On an event of critical trip temperature crossing. Thermal framework
624 queue to fire after a pre-determined number of seconds to start
635 profiled non-zero positive value is a must for emergerncy poweroff to be