UPSTREAM: thermal: core: Connect the threshold with the core

Initialize, de-initialize and handle the threshold in the same place
than the trip points.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20240923100005.2532430-3-daniel.lezcano@linaro.org
[ rjw: Subject edit ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Bug: 390217395
Change-Id: Ibdee6c53a23f7a02447675e1a1c390a62551d226
(cherry picked from commit 85ee9449f76430846132b0248a99a6cfb524f992)
Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
This commit is contained in:
Daniel Lezcano
2024-09-23 11:59:58 +02:00
committed by Treehugger Robot
parent 3647a3efec
commit 492d276995
+9
View File
@@ -587,6 +587,8 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
high = td->threshold;
}
thermal_thresholds_handle(tz, &low, &high);
thermal_zone_set_trips(tz, low, high);
list_sort(NULL, &way_up_list, thermal_trip_notify_cmp);
@@ -1514,6 +1516,10 @@ thermal_zone_device_register_with_trips(const char *type,
goto unregister;
}
result = thermal_thresholds_init(tz);
if (result)
goto remove_hwmon;
mutex_lock(&thermal_list_lock);
mutex_lock(&tz->lock);
@@ -1534,6 +1540,8 @@ thermal_zone_device_register_with_trips(const char *type,
return tz;
remove_hwmon:
thermal_remove_hwmon_sysfs(tz);
unregister:
device_del(&tz->device);
release_device:
@@ -1621,6 +1629,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
thermal_set_governor(tz, NULL);
thermal_thresholds_exit(tz);
thermal_remove_hwmon_sysfs(tz);
ida_free(&thermal_tz_ida, tz->id);
ida_destroy(&tz->ida);