diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-09-16 09:05:54 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-09-16 09:05:54 +0300 |
commit | d22300518d875f78203e9afacb5aa0b0316da523 (patch) | |
tree | 384603167b4a6964ad7679eee36af5b47181347c /drivers/platform | |
parent | 02824a5fd11f99b4637668926a59aab3698b46a9 (diff) | |
parent | 3bc5ed15bdc5077d7ee621f44872f550babbea3e (diff) | |
download | linux-d22300518d875f78203e9afacb5aa0b0316da523.tar.xz |
Merge tag 'thermal-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control updates from Rafael Wysocki:
"These mostly continue to rework the thermal core and the thermal zone
driver interface to make the code more straightforward and reduce
bloat
The most significant piece of this work is a change of the code
related to binding cooling devices to thermal zones which, among other
things, replaces two previously existing thermal zone operations with
one allowing driver implementations to be much simpler
There is also a new thermal core testing module allowing mock thermal
zones to be created and controlled via debugfs in order to exercise
the thermal core functionality. It is expected to be used for
implementing thermal core self tests in the future
Apart from the above, there are assorted thermal driver updates
Specifics:
- Update some thermal drivers to eliminate thermal_zone_get_trip()
calls from them and get rid of that function (Rafael Wysocki)
- Update the thermal sysfs code to store trip point attributes in
trip descriptors and get to trip points via attribute pointers
(Rafael Wysocki)
- Move the computation of the low and high boundaries for
thermal_zone_set_trips() to __thermal_zone_device_update() (Daniel
Lezcano)
- Introduce a debugfs-based facility for thermal core testing (Rafael
Wysocki)
- Replace the thermal zone .bind() and .unbind() callbacks for
binding cooling devices to thermal zones with one .should_bind()
callback used for deciding whether or not a given cooling devices
should be bound to a given trip point in a given thermal zone
(Rafael Wysocki)
- Eliminate code that has no more users after the other changes, drop
some redundant checks from the thermal core and clean it up (Rafael
Wysocki)
- Fix rounding of delay jiffies in the thermal core (Rafael Wysocki)
- Refuse to accept trip point temperature or hysteresis that would
lead to an invalid threshold value when setting them via sysfs
(Rafael Wysocki)
- Adjust states of all uninitialized instances in the .manage()
callback of the Bang-bang thermal governor (Rafael Wysocki)
- Drop a couple of redundant checks along with the code depending on
them from the thermal core (Rafael Wysocki)
- Rearrange the thermal core to avoid redundant checks and simplify
control flow in a couple of code paths (Rafael Wysocki)
- Add power domain DT bindings for new Amlogic SoCs (Georges Stark)
- Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() in the ST
driver and add a Kconfig dependency on THERMAL_OF subsystem for the
STi driver (Raphael Gallais-Pou)
- Simplify the error code path in the probe functions in the brcmstb
driver with the helo of dev_err_probe() (Yan Zhen)
- Make imx_sc_thermal use dev_err_probe() (Alexander Stein)
- Remove trailing space after \n newline in the Renesas driver (Colin
Ian King)
- Add DT binding compatible string for the SA8255p to the tsens
thermal driver (Nikunj Kela)
- Use the devm_clk_get_enabled() helpers to simplify the init routine
in the sprd thermal driver (Huan Yang)
- Remove __maybe_unused notations for the functions by using the new
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros on the IMx and
Qoriq drivers (Fabio Estevam)
- Remove unused declarations from the ti-soc-thermal driver's header
file as the functions in question were removed previously (Zhang
Zekun)"
* tag 'thermal-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (48 commits)
thermal: core: Drop thermal_zone_device_is_enabled()
thermal: core: Check passive delay in monitor_thermal_zone()
thermal: core: Drop dead code from monitor_thermal_zone()
thermal: core: Drop redundant lockdep_assert_held()
thermal: gov_bang_bang: Adjust states of all uninitialized instances
thermal: sysfs: Add sanity checks for trip temperature and hysteresis
thermal/drivers/imx_sc_thermal: Use dev_err_probe
thermal/drivers/ti-soc-thermal: Remove unused declarations
thermal/drivers/imx: Remove __maybe_unused notations
thermal/drivers/qoriq: Remove __maybe_unused notations
thermal/drivers/sprd: Use devm_clk_get_enabled() helpers
dt-bindings: thermal: tsens: document support on SA8255p
thermal/drivers/renesas: Remove trailing space after \n newline
thermal/drivers/brcmstb_thermal: Simplify with dev_err_probe()
thermal/drivers/sti: Depend on THERMAL_OF subsystem
thermal/drivers/st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
dt-bindings: thermal: amlogic,thermal: add optional power-domains
thermal: core: Drop tz field from struct thermal_instance
thermal: core: Drop redundant checks from thermal_bind_cdev_to_trip()
thermal: core: Rename cdev-to-thermal-zone bind/unbind functions
...
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/acerhdf.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 018c48429616..4c3bb68e8fe4 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c @@ -378,33 +378,13 @@ static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal, int *t) return 0; } -static int acerhdf_bind(struct thermal_zone_device *thermal, - struct thermal_cooling_device *cdev) +static bool acerhdf_should_bind(struct thermal_zone_device *thermal, + const struct thermal_trip *trip, + struct thermal_cooling_device *cdev, + struct cooling_spec *c) { /* if the cooling device is the one from acerhdf bind it */ - if (cdev != cl_dev) - return 0; - - if (thermal_zone_bind_cooling_device(thermal, 0, cdev, - THERMAL_NO_LIMIT, THERMAL_NO_LIMIT, - THERMAL_WEIGHT_DEFAULT)) { - pr_err("error binding cooling dev\n"); - return -EINVAL; - } - return 0; -} - -static int acerhdf_unbind(struct thermal_zone_device *thermal, - struct thermal_cooling_device *cdev) -{ - if (cdev != cl_dev) - return 0; - - if (thermal_zone_unbind_cooling_device(thermal, 0, cdev)) { - pr_err("error unbinding cooling dev\n"); - return -EINVAL; - } - return 0; + return cdev == cl_dev && trip->type == THERMAL_TRIP_ACTIVE; } static inline void acerhdf_revert_to_bios_mode(void) @@ -447,8 +427,7 @@ static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal, /* bind callback functions to thermalzone */ static struct thermal_zone_device_ops acerhdf_dev_ops = { - .bind = acerhdf_bind, - .unbind = acerhdf_unbind, + .should_bind = acerhdf_should_bind, .get_temp = acerhdf_get_ec_temp, .change_mode = acerhdf_change_mode, .get_crit_temp = acerhdf_get_crit_temp, |