diff options
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/thermal_core.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index b26e6f7a050c..7e71f5b01cca 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -612,6 +612,11 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) thermal_zone_set_trips(tz); +#ifdef CONFIG_ARCH_ROCKCHIP + srcu_notifier_call_chain(&tz->thermal_notifier_list, + tz->temperature, tz); +#endif + for (count = 0; count < tz->trips; count++) handle_thermal_trip(tz, count); } @@ -1870,7 +1875,9 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL); if (!tz) return ERR_PTR(-ENOMEM); - +#ifdef CONFIG_ARCH_ROCKCHIP + srcu_init_notifier_head(&tz->thermal_notifier_list); +#endif INIT_LIST_HEAD(&tz->thermal_instances); idr_init(&tz->idr); mutex_init(&tz->lock); @@ -2067,6 +2074,9 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) thermal_set_governor(tz, NULL); thermal_remove_hwmon_sysfs(tz); +#ifdef CONFIG_ARCH_ROCKCHIP + srcu_cleanup_notifier_head(&tz->thermal_notifier_list); +#endif release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); idr_destroy(&tz->idr); mutex_destroy(&tz->lock); |