From 55cdf0a283b876050f0c502685adc346180d7a2f Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 6 Jul 2020 12:55:38 +0200 Subject: 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 Signed-off-by: Daniel Lezcano Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200706105538.2159-4-daniel.lezcano@linaro.org --- drivers/thermal/thermal_sysfs.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'drivers/thermal/thermal_sysfs.c') 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; -- cgit v1.2.3