diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2020-07-06 13:55:38 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2020-07-07 16:55:22 +0300 |
commit | 55cdf0a283b876050f0c502685adc346180d7a2f (patch) | |
tree | 041d310afabaec26759c39d1419a21f99d817db3 /drivers/thermal/thermal_sysfs.c | |
parent | 1ce50e7d408ef2bdc8ca021363fd46d1b8bfad00 (diff) | |
download | linux-55cdf0a283b876050f0c502685adc346180d7a2f.tar.xz |
thermal: core: Add notifications call in the framework
The generic netlink protocol is implemented but the different
notification functions are not yet connected to the core code.
These changes add the notification calls in the different
corresponding places.
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20200706105538.2159-4-daniel.lezcano@linaro.org
Diffstat (limited to 'drivers/thermal/thermal_sysfs.c')
-rw-r--r-- | drivers/thermal/thermal_sysfs.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index c23d67c4dc4e..8c231219e15d 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -112,7 +112,8 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, { struct thermal_zone_device *tz = to_thermal_zone(dev); int trip, ret; - int temperature; + int temperature, hyst = 0; + enum thermal_trip_type type; if (!tz->ops->set_trip_temp) return -EPERM; @@ -127,6 +128,18 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, if (ret) return ret; + if (tz->ops->get_trip_hyst) { + ret = tz->ops->get_trip_hyst(tz, trip, &hyst); + if (ret) + return ret; + } + + ret = tz->ops->get_trip_type(tz, trip, &type); + if (ret) + return ret; + + thermal_notify_tz_trip_change(tz->id, trip, type, temperature, hyst); + thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); return count; |