@@ -59,8 +59,8 @@ mode_show(struct device *dev, struct device_attribute *attr, char *buf)
if (result)
return result;
- return sprintf(buf, "%s\n", mode == THERMAL_DEVICE_ENABLED ? "enabled"
- : "disabled");
+ return sprintf(buf, "%s\n", mode == THERMAL_DEVICE_DISABLED ? "disabled"
+ : "enabled");
}
static ssize_t
@@ -48,8 +48,9 @@ struct thermal_cooling_device;
struct thermal_instance;
enum thermal_device_mode {
- THERMAL_DEVICE_DISABLED = 0,
+ THERMAL_DEVICE_INITIAL = 0,
THERMAL_DEVICE_ENABLED,
+ THERMAL_DEVICE_DISABLED,
};
enum thermal_trip_type {
Add a new mode: THERMAL_DEVICE_INITIAL. It is dedicated to handle devices which must be initially DISABLED, but which are polled at startup nonetheless. THERMAL_DEVICE_INITIAL shall be reported as "enabled" in sysfs to keep the userspace interface intact. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> --- drivers/thermal/thermal_sysfs.c | 4 ++-- include/linux/thermal.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)