Skip to contentSkip to conversation

thermal: core: Add thermal zone enable/disable notification

PATCH In review Daniel Lezcano 3 participants 4 messages Jul 27, 2020 – Jul 29, 2020 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: core: Add thermal zone enable/disable notification

Now the calls to enable/disable a thermal zone are centralized in a call to a function, we can add in these the corresponding netlink notifications.

---
 drivers/thermal/thermal_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/thermal/thermal_core.c +5 -0
index 9748fbb9a3a1..72bf159bcecc 100644
@@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
 
 	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
 
+	if (mode == THERMAL_DEVICE_ENABLED)
+		thermal_notify_tz_enable(tz->id);
+	else
+		thermal_notify_tz_disable(tz->id);
+
 	return ret;
 }
 
Signature · 1 line
2.17.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Daniel Lezcano

Now the calls to enable/disable a thermal zone are centralized in a call to a function, we can add in these the corresponding netlink notifications.

Quoted 22 lines
---
 drivers/thermal/thermal_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/thermal/thermal_core.c +5 -0
index 9748fbb9a3a1..72bf159bcecc 100644
@@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct
 thermal_zone_device *tz,
 
 	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
 
+	if (mode == THERMAL_DEVICE_ENABLED)
+		thermal_notify_tz_enable(tz->id);
+	else
+		thermal_notify_tz_disable(tz->id);
+
 	return ret;
 }
Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Lezcano
Quoted 6 lines · Daniel Lezcano

Now the calls to enable/disable a thermal zone are centralized in a call to a function, we can add in these the corresponding netlink notifications.

Quoted 23 lines
---
 drivers/thermal/thermal_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/thermal/thermal_core.c +5 -1
index 9748fbb9a3a1..72bf159bcecc 100644
@@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
 
        thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
 
+       if (mode == THERMAL_DEVICE_ENABLED)
+               thermal_notify_tz_enable(tz->id);
+       else
+               thermal_notify_tz_disable(tz->id);
+
        return ret;
 }
 
--

2.17.1

author Applied
#3 lore raw
Quoted 10 lines · Amit Kucheria
Quoted 6 lines · Daniel Lezcano

Now the calls to enable/disable a thermal zone are centralized in a call to a function, we can add in these the corresponding netlink notifications.

I've applied the changes, thanks for the review.

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog