The user thresholds mechanism is a way to have the userspace to tell the thermal framework to send a notification when a temperature limit is crossed. There is no id, no hysteresis, just the temperature and the direction of the limit crossing. That means we can be notified when a threshold is crossed the way up only, or the way down only or both ways. That allows to create hysteresis values if it is needed. A threshold can be added, deleted or flushed. The latter means all thresholds belonging to a thermal zone will be deleted. When a threshold is added: - if the same threshold (temperature and direction) exists, an error is returned - if a threshold is specified with the same temperature but a different direction, the specified direction is added - if there is no threshold with the same temperature then it is created When a threshold is deleted: - if the same threshold (temperature and direction) exists, it is deleted - if a threshold is specified with the same temperature but a different direction, the specified direction is removed - if there is no threshold with the same temperature, then an error is returned When the threshold are flushed: - All thresholds related to a thermal zone are deleted When a threshold is crossed: - the userspace does not need to know which threshold(s) have been crossed, it will be notified with the current temperature and the previous temperature - if multiple thresholds have been crossed between two updates only one notification will be send to the userspace, it is pointless to send a notification per thresholds crossed as the userspace can handle that easily when it has the temperature delta information
Showing the changes to include/uapi (1 of 6 files). Show all
Unified · Split
| @@ -3,6 +3,8 @@ · 2 unmodified lines | ||
| 3 | 3 | #define _UAPI_LINUX_THERMAL_H |
| 4 | 4 | |
| 5 | 5 | #define THERMAL_NAME_LENGTH 20 |
| 6 | +#define THERMAL_THRESHOLD_WAY_UP BIT(0) | |
| 7 | +#define THERMAL_THRESHOLD_WAY_DOWN BIT(1) | |
| 6 | 8 | |
| 7 | 9 | enum thermal_device_mode { |
| 8 | 10 | THERMAL_DEVICE_DISABLED = 0, |