]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: acerhdf: Use the .should_bind() thermal zone callback
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 19 Aug 2024 16:19:35 +0000 (18:19 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 22 Aug 2024 15:43:14 +0000 (17:43 +0200)
commit13b6b63d6becb62ede986f35b14c873ac935e2e3
treed4345d3968185de7e2a4affb2cd2de9e31874827
parent2fb85633641770d55b50c934db6b4fb02411a1fe
platform/x86: acerhdf: Use the .should_bind() thermal zone callback

Make the acerhdf driver use the .should_bind() thermal zone
callback to provide the thermal core with the information on whether or
not to bind the given cooling device to the given trip point in the
given thermal zone.  If it returns 'true', the thermal core will bind
the cooling device to the trip and the corresponding unbinding will be
taken care of automatically by the core on the removal of the involved
thermal zone or cooling device.

The previously existing acerhdf_bind() function bound cooling devices
to thermal trip point 0 only, so the new callback needs to return 'true'
for trip point 0.  However, it is straightforward to observe that trip
point 0 is an active trip point and the only other trip point in the
driver's thermal zone is a critical one, so it is sufficient to return
'true' from that callback if the type of the given trip point is
THERMAL_TRIP_ACTIVE.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Peter Kästle <peter@piie.net>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/3779411.MHq7AAxBmi@rjwysocki.net
drivers/platform/x86/acerhdf.c