thermal: trip: Send trip change notifications on all trip updates
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Dec 2023 19:18:39 +0000 (20:18 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 Dec 2023 11:37:01 +0000 (12:37 +0100)
commitbdc22c8d52d70fc5655ab4dbf72fa79b034bb7b5
treede1e48e379f331993d03aac316222d189e710845
parent183b64132f9692b15545c1aad755e71a53bcfb94
thermal: trip: Send trip change notifications on all trip updates

The _store callbacks of the trip point temperature and hysteresis sysfs
attributes invoke thermal_notify_tz_trip_change() to send a notification
regarding the trip point change, but when trip points are updated by the
platform firmware, trip point change notifications are not sent.

To make the behavior after a trip point change more consistent,
modify all of the 3 places where trip point temperature is updated
to use a new function called thermal_zone_set_trip_temp() for this
purpose and make that function call thermal_notify_tz_trip_change().

Note that trip point hysteresis can only be updated via sysfs and
trip_point_hyst_store() calls thermal_notify_tz_trip_change() already,
so this code path need not be changed.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/acpi/thermal.c
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
drivers/thermal/thermal_sysfs.c
drivers/thermal/thermal_trip.c
include/linux/thermal.h