Loading Documentation/thermal/sysfs-api.txt +1 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ passive passive trip point for the zone. Activation is done by polling with an interval of 1 second. Unit: millidegrees Celsius Valid values: 0 (disabled) or greater than 1000 RW, Optional ***************************** Loading drivers/acpi/thermal.c +7 −0 Original line number Diff line number Diff line Loading @@ -1052,6 +1052,13 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) acpi_device_bid(device)); } seq_puts(seq, "\n"); } else { seq_printf(seq, "passive (forced):"); if (tz->thermal_zone->forced_passive) seq_printf(seq, " %i C\n", tz->thermal_zone->forced_passive / 1000); else seq_printf(seq, "<not set>\n"); } for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { Loading drivers/thermal/thermal_sys.c +11 −6 Original line number Diff line number Diff line Loading @@ -225,6 +225,12 @@ passive_store(struct device *dev, struct device_attribute *attr, if (!sscanf(buf, "%d\n", &state)) return -EINVAL; /* sanity check: values below 1000 millicelcius don't make sense * and can cause the system to go into a thermal heart attack */ if (state && state < 1000) return -EINVAL; if (state && !tz->forced_passive) { mutex_lock(&thermal_list_lock); list_for_each_entry(cdev, &thermal_cdev_list, node) { Loading @@ -235,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr, cdev); } mutex_unlock(&thermal_list_lock); if (!tz->passive_delay) tz->passive_delay = 1000; } else if (!state && tz->forced_passive) { mutex_lock(&thermal_list_lock); list_for_each_entry(cdev, &thermal_cdev_list, node) { Loading @@ -245,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr, cdev); } mutex_unlock(&thermal_list_lock); tz->passive_delay = 0; } tz->tc1 = 1; tz->tc2 = 1; if (!tz->passive_delay) tz->passive_delay = 1000; if (!tz->polling_delay) tz->polling_delay = 10000; tz->forced_passive = state; thermal_zone_device_update(tz); Loading Loading @@ -1016,6 +1019,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) thermal_zone_device_set_polling(tz, tz->passive_delay); else if (tz->polling_delay) thermal_zone_device_set_polling(tz, tz->polling_delay); else thermal_zone_device_set_polling(tz, 0); mutex_unlock(&tz->lock); } EXPORT_SYMBOL(thermal_zone_device_update); Loading Loading
Documentation/thermal/sysfs-api.txt +1 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ passive passive trip point for the zone. Activation is done by polling with an interval of 1 second. Unit: millidegrees Celsius Valid values: 0 (disabled) or greater than 1000 RW, Optional ***************************** Loading
drivers/acpi/thermal.c +7 −0 Original line number Diff line number Diff line Loading @@ -1052,6 +1052,13 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) acpi_device_bid(device)); } seq_puts(seq, "\n"); } else { seq_printf(seq, "passive (forced):"); if (tz->thermal_zone->forced_passive) seq_printf(seq, " %i C\n", tz->thermal_zone->forced_passive / 1000); else seq_printf(seq, "<not set>\n"); } for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { Loading
drivers/thermal/thermal_sys.c +11 −6 Original line number Diff line number Diff line Loading @@ -225,6 +225,12 @@ passive_store(struct device *dev, struct device_attribute *attr, if (!sscanf(buf, "%d\n", &state)) return -EINVAL; /* sanity check: values below 1000 millicelcius don't make sense * and can cause the system to go into a thermal heart attack */ if (state && state < 1000) return -EINVAL; if (state && !tz->forced_passive) { mutex_lock(&thermal_list_lock); list_for_each_entry(cdev, &thermal_cdev_list, node) { Loading @@ -235,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr, cdev); } mutex_unlock(&thermal_list_lock); if (!tz->passive_delay) tz->passive_delay = 1000; } else if (!state && tz->forced_passive) { mutex_lock(&thermal_list_lock); list_for_each_entry(cdev, &thermal_cdev_list, node) { Loading @@ -245,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr, cdev); } mutex_unlock(&thermal_list_lock); tz->passive_delay = 0; } tz->tc1 = 1; tz->tc2 = 1; if (!tz->passive_delay) tz->passive_delay = 1000; if (!tz->polling_delay) tz->polling_delay = 10000; tz->forced_passive = state; thermal_zone_device_update(tz); Loading Loading @@ -1016,6 +1019,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) thermal_zone_device_set_polling(tz, tz->passive_delay); else if (tz->polling_delay) thermal_zone_device_set_polling(tz, tz->polling_delay); else thermal_zone_device_set_polling(tz, 0); mutex_unlock(&tz->lock); } EXPORT_SYMBOL(thermal_zone_device_update); Loading