aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-22 19:06:05 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-27 12:04:01 +0100
commitcca52f696952962f020c7e1393740d0ba07c3dc2 (patch)
tree8cee370eb1e0cd4d5806623ec38d3bff27ade7a1 /drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
parent46f5bef8ec2e1e05ad2fda0bcf5ac32e191ec694 (diff)
thermal: intel: Set THERMAL_TRIP_FLAG_RW_TEMP directly
Some Intel thermal drivers need/want the temperature of their trip points to be set by user space via sysfs and so they pass nonzero writable trip masks during thermal zone registration for this purpose. It is now possible to achieve the same result by setting the THERMAL_TRIP_FLAG_RW_TEMP trip flag directly, so modify the drivers in question to do that instead of using a nonzero writable trips mask. No intentional functional impact. Note that this change is requisite for dropping the mask argument from thermal_zone_device_register_with_trips() going forward. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c')
-rw-r--r--drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
index 1b0a9e9206c4..0e8148afb490 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -129,7 +129,6 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
struct thermal_trip *zone_trips;
unsigned long long trip_cnt = 0;
unsigned long long hyst;
- int trip_mask = 0;
acpi_status status;
int i, ret;
@@ -140,10 +139,8 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
int34x_zone->adev = adev;
status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt);
- if (ACPI_SUCCESS(status)) {
+ if (ACPI_SUCCESS(status))
int34x_zone->aux_trip_nr = trip_cnt;
- trip_mask = BIT(trip_cnt) - 1;
- }
zone_trips = kzalloc(sizeof(*zone_trips) * (trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT),
GFP_KERNEL);
@@ -155,6 +152,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
for (i = 0; i < trip_cnt; i++) {
zone_trips[i].type = THERMAL_TRIP_PASSIVE;
zone_trips[i].temperature = THERMAL_TEMP_INVALID;
+ zone_trips[i].flags |= THERMAL_TRIP_FLAG_RW_TEMP;
}
trip_cnt = int340x_thermal_read_trips(adev, zone_trips, trip_cnt);
@@ -173,7 +171,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
int34x_zone->zone = thermal_zone_device_register_with_trips(
acpi_device_bid(adev),
zone_trips, trip_cnt,
- trip_mask, int34x_zone,
+ 0, int34x_zone,
&zone_ops,
&int340x_thermal_params,
0, 0);