Skip to content

Commit a2ee758

Browse files
jbrasenrafaeljw
authored andcommitted
ACPI: thermal: Add Thermal fast Sampling Period (_TFP) support
Add support of "Thermal fast Sampling Period (_TFP)" for passive cooling. As per the ACPI specification (ACPI 6.5, Section 11.4.17 "_TFP (Thermal fast Sampling Period)", _TFP overrides _TSP ("Thermal Sampling Period" if both are present in a Thermal zone. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Co-developed-by: Sumit Gupta <sumitg@nvidia.com> Signed-off-by: Sumit Gupta <sumitg@nvidia.com> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9c86472 commit a2ee758

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/acpi/thermal.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct acpi_thermal_passive {
9292
struct acpi_thermal_trip trip;
9393
unsigned long tc1;
9494
unsigned long tc2;
95-
unsigned long tsp;
95+
unsigned long delay;
9696
};
9797

9898
struct acpi_thermal_active {
@@ -396,11 +396,17 @@ static bool passive_trip_params_init(struct acpi_thermal *tz)
396396

397397
tz->trips.passive.tc2 = tmp;
398398

399+
status = acpi_evaluate_integer(tz->device->handle, "_TFP", NULL, &tmp);
400+
if (ACPI_SUCCESS(status)) {
401+
tz->trips.passive.delay = tmp;
402+
return true;
403+
}
404+
399405
status = acpi_evaluate_integer(tz->device->handle, "_TSP", NULL, &tmp);
400406
if (ACPI_FAILURE(status))
401407
return false;
402408

403-
tz->trips.passive.tsp = tmp;
409+
tz->trips.passive.delay = tmp * 100;
404410

405411
return true;
406412
}
@@ -896,7 +902,7 @@ static int acpi_thermal_add(struct acpi_device *device)
896902

897903
acpi_trip = &tz->trips.passive.trip;
898904
if (acpi_thermal_trip_valid(acpi_trip)) {
899-
passive_delay = tz->trips.passive.tsp * 100;
905+
passive_delay = tz->trips.passive.delay;
900906

901907
trip->type = THERMAL_TRIP_PASSIVE;
902908
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk);

0 commit comments

Comments
 (0)