Lines Matching +full:thermal +full:- +full:sensor
2 Generic Thermal Sysfs driver How To
15 The generic thermal sysfs provides a set of interfaces for thermal zone
16 devices (sensors) and thermal cooling devices (fan, processor...) to register
17 with the thermal management solution and to be a part of it.
19 This how-to focuses on enabling new thermal zone and cooling devices to
20 participate in thermal management.
21 This solution is platform independent and any type of thermal zone devices
24 The main task of the thermal sysfs driver is to expose thermal zone attributes
26 An intelligent thermal management application can make decisions based on
27 inputs from thermal zone attributes (the current temperature and trip point
30 - `[0-*]` denotes any positive number starting from 0
31 - `[1-*]` denotes any positive number starting from 1
33 1. thermal sysfs driver interface functions
36 1.1 thermal zone device interface
37 ---------------------------------
48 This interface function adds a new thermal zone device (sensor) to
49 /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to bind all the
50 thermal cooling devices registered at the same time.
53 the thermal zone type.
55 the total number of trip points this thermal zone supports.
61 thermal zone device call-backs.
64 bind the thermal zone device with a thermal cooling device.
66 unbind the thermal zone device with a thermal cooling device.
68 get the current temperature of the thermal zone.
74 get the current mode (enabled/disabled) of the thermal zone.
76 - "enabled" means the kernel thermal management is
78 - "disabled" will prevent kernel thermal driver action
80 charge of thermal management.
82 set the mode (enabled/disabled) of the thermal zone.
92 thermal zone platform parameters.
104 This interface function removes the thermal zone device.
105 It deletes the corresponding entry from /sys/class/thermal folder and
106 unbinds all the thermal cooling devices it uses.
115 This interface adds a new sensor to a DT thermal zone.
116 This function will search the list of thermal zones described in
117 device tree and look for the zone that refer to the sensor device
118 pointed by dev->of_node as temperature providers. For the zone
119 pointing to the sensor node, the sensor will be added to the DT
120 thermal zone device.
125 Device node of sensor containing valid node pointer in
126 dev->of_node.
128 a sensor identifier, in case the sensor IP has more
138 sensor temperature. This is mandatory
139 callback provided by sensor driver.
142 left the driver must inform the thermal
145 sensor temperature trend.
147 sensor emulated temperature.
150 The thermal zone temperature is provided by the get_temp() function
154 It returns error pointer if fails otherwise valid thermal zone device
163 This interface unregisters a sensor from a DT thermal zone which was
165 This function removes the sensor callbacks and private data from the
166 thermal zone device registered with thermal_zone_of_sensor_register()
168 get_trend() thermal zone device callbacks.
184 The benefit of using this interface to register sensor is that it
206 for the thermal zone device, which might be useful for platform
214 for the thermal zone device, which might be useful for platform
217 1.2 thermal cooling device interface
218 ------------------------------------
227 This interface function adds a new thermal cooling device (fan/processor/...)
228 to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries to bind itself
229 to all the thermal zone devices registered at the same time.
236 thermal cooling devices call-backs.
250 This interface function removes the thermal cooling device.
251 It deletes the corresponding entry from /sys/class/thermal folder and
252 unbinds itself from all the thermal zone devices using it.
254 1.3 interface for binding a thermal zone device with a thermal cooling device
255 -----------------------------------------------------------------------------
263 This interface function binds a thermal cooling device to a particular trip
264 point of a thermal zone device.
266 This function is usually called in the thermal zone device .bind callback.
269 the thermal zone device
271 thermal cooling device
273 indicates which trip point in this thermal zone the cooling device
284 the influence of this cooling device in this thermal
292 This interface function unbinds a thermal cooling device from a particular
293 trip point of a thermal zone device. This function is usually called in
294 the thermal zone device .unbind callback.
297 the thermal zone device
299 thermal cooling device
301 indicates which trip point in this thermal zone the cooling device
304 1.4 Thermal Zone Parameters
305 ---------------------------
328 this thermal zone and cdev, for a particular trip point.
329 If nth bit is set, then the cdev and thermal zone are bound
334 array consisting of tuples <lower-state upper-state> of
347 This structure defines the platform level parameters for a thermal zone.
348 This data, for each thermal zone should come from the platform layer.
353 Name of the thermal governor used for this zone
355 a boolean to indicate if the thermal to hwmon sysfs interface
374 Thermal sysfs attributes will be represented under /sys/class/thermal.
378 Thermal zone device sys I/F, created once it's registered::
380 /sys/class/thermal/thermal_zone[0-*]:
381 |---type: Type of the thermal zone
382 |---temp: Current temperature
383 |---mode: Working mode of the thermal zone
384 |---policy: Thermal governor used for this zone
385 |---available_policies: Available thermal governors for this zone
386 |---trip_point_[0-*]_temp: Trip point temperature
387 |---trip_point_[0-*]_type: Trip point type
388 |---trip_point_[0-*]_hyst: Hysteresis value for this trip point
389 |---emul_temp: Emulated temperature set node
390 |---sustainable_power: Sustainable dissipatable power
391 |---k_po: Proportional term during temperature overshoot
392 |---k_pu: Proportional term during temperature undershoot
393 |---k_i: PID's integral term in the power allocator gov
394 |---k_d: PID's derivative term in the power allocator
395 |---integral_cutoff: Offset above which errors are accumulated
396 |---slope: Slope constant applied as linear extrapolation
397 |---offset: Offset constant applied as linear extrapolation
399 Thermal cooling device sys I/F, created once it's registered::
401 /sys/class/thermal/cooling_device[0-*]:
402 |---type: Type of the cooling device(processor/fan/...)
403 |---max_state: Maximum cooling state of the cooling device
404 |---cur_state: Current cooling state of the cooling device
405 |---stats: Directory containing cooling device's statistics
406 |---stats/reset: Writing any value resets the statistics
407 |---stats/time_in_state_ms: Time (msec) spent in various cooling states
408 |---stats/total_trans: Total number of times cooling state is changed
409 |---stats/trans_table: Cooing state transition table
413 the relationship between a thermal zone and its associated cooling device.
419 /sys/class/thermal/thermal_zone[0-*]:
420 |---cdev[0-*]: [0-*]th cooling device in current thermal zone
421 |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
422 |---cdev[0-*]_weight: Influence of the cooling device in
423 this thermal zone
425 Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
426 the generic thermal driver also creates a hwmon sysfs I/F for each _type_
427 of thermal zone device. E.g. the generic thermal driver registers one hwmon
429 ACPI thermal zones.
433 /sys/class/hwmon/hwmon[0-*]:
434 |---name: The type of the thermal zone devices
435 |---temp[1-*]_input: The current temperature of thermal zone [1-*]
436 |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]
438 Please read Documentation/hwmon/sysfs-interface.rst for additional information.
440 Thermal zone attributes
441 -----------------------
444 Strings which represent the thermal zone type.
445 This is given by thermal zone driver as part of registration.
446 E.g: "acpitz" indicates it's an ACPI thermal device.
452 Current temperature as reported by thermal zone (sensor).
459 managing the thermal zone. It can be either default kernel based
463 enable Kernel Thermal management.
465 Preventing kernel thermal zone driver actions upon
467 charge of the thermal management.
472 One of the various thermal governors used for a particular zone.
477 Available thermal governors which can be used for a particular zone.
481 `trip_point_[0-*]_temp`
488 `trip_point_[0-*]_type`
491 E.g. it can be one of critical, hot, passive, `active[0-*]` for ACPI
492 thermal zone.
496 `trip_point_[0-*]_hyst`
501 `cdev[0-*]`
502 Sysfs link to the thermal cooling device node where the sys I/F
507 `cdev[0-*]_trip_point`
508 The trip point in this thermal zone which `cdev[0-*]` is associated
509 with; -1 means the cooling device is not associated with any trip
514 `cdev[0-*]_weight`
515 The influence of `cdev[0-*]` in this thermal zone. This value
516 is relative to the rest of cooling devices in the thermal
519 thermal zone.
525 policy is not supported by native thermal driver. Default is zero
537 Interface to set the emulated temperature method in thermal zone
538 (sensor). After setting this temperature, the thermal zone may pass
549 because userland can easily disable the thermal policy by simply
554 the thermal zone. Used by the power allocator governor. For
555 more information see Documentation/driver-api/thermal/power_allocator.rst
566 Documentation/driver-api/thermal/power_allocator.rst
575 Documentation/driver-api/thermal/power_allocator.rst
583 Documentation/driver-api/thermal/power_allocator.rst
590 Documentation/driver-api/thermal/power_allocator.rst
601 Documentation/driver-api/thermal/power_allocator.rst
609 to determine a hotspot temperature based off the sensor's
617 to determine a hotspot temperature based off the sensor's
624 -------------------------
629 - for generic ACPI: should be "Fan", "Processor" or "LCD"
630 - for memory controller device on intel_menlow platform:
644 - cur_state == 0 means no cooling
645 - cur_state == max_state means the maximum cooling.
673 reading this will return an -EFBIG error.
679 ACPI thermal zone may support multiple trip points like critical, hot,
680 passive, active. If an ACPI thermal zone supports critical, passive,
685 effectiveness in cooling the thermal zone.
690 /sys/class/thermal:
692 |---type: acpitz
693 |---temp: 37000
694 |---mode: enabled
695 |---policy: step_wise
696 |---available_policies: step_wise fair_share
697 |---trip_point_0_temp: 100000
698 |---trip_point_0_type: critical
699 |---trip_point_1_temp: 80000
700 |---trip_point_1_type: passive
701 |---trip_point_2_temp: 70000
702 |---trip_point_2_type: active0
703 |---trip_point_3_temp: 60000
704 |---trip_point_3_type: active1
705 |---cdev0: --->/sys/class/thermal/cooling_device0
706 |---cdev0_trip_point: 1 /* cdev0 can be used for passive */
707 |---cdev0_weight: 1024
708 |---cdev1: --->/sys/class/thermal/cooling_device3
709 |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/
710 |---cdev1_weight: 1024
713 |---type: Processor
714 |---max_state: 8
715 |---cur_state: 0
718 |---type: Fan
719 |---max_state: 2
720 |---cur_state: 0
724 |---name: acpitz
725 |---temp1_input: 37000
726 |---temp1_crit: 100000
732 -----------------
734 This function returns the trend of a thermal zone, i.e the rate of change
735 of temperature of the thermal zone. Ideally, the thermal sensor drivers
736 are supposed to implement the callback. If they don't, the thermal
741 -------------------------
748 -----------------------------
750 This function handles the trip events from sensor drivers. It starts
758 ------------------------
767 On an event of critical trip temperature crossing. Thermal framework
772 queue to fire after a pre-determined number of seconds to start
783 profiled non-zero positive value is a must for emergerncy poweroff to be