thermal: core: Add thermal zone enable/disable notification
diff mbox series

Message ID 20200727231033.26512-1-daniel.lezcano@linaro.org
State Accepted
Commit 25be77e588a63b064e8d9c1b59975e6882abc2f9
Headers show
Series
  • thermal: core: Add thermal zone enable/disable notification
Related show

Commit Message

Daniel Lezcano July 27, 2020, 11:10 p.m. UTC
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.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Zhang Rui July 28, 2020, 7:49 a.m. UTC | #1
On Tue, 2020-07-28 at 01:10 +0200, Daniel Lezcano wrote:
> 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.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Acked-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/thermal/thermal_core.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c
> index 9748fbb9a3a1..72bf159bcecc 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -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;
>  }
>
Amit Kucheria July 29, 2020, 5:36 a.m. UTC | #2
On Tue, Jul 28, 2020 at 4:40 AM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> 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.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 9748fbb9a3a1..72bf159bcecc 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -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
>
Daniel Lezcano July 29, 2020, 8:40 a.m. UTC | #3
On 29/07/2020 07:36, Amit Kucheria wrote:
> On Tue, Jul 28, 2020 at 4:40 AM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> 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.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> 
> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

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

Patch
diff mbox series

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 9748fbb9a3a1..72bf159bcecc 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -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;
 }