On Wed, 2023-01-04 at 23:21 +0100, Daniel Lezcano wrote:
From: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
The thermal framework gives the possibility to register the trip
points with the thermal zone. When that is done, no get_trip_* ops
are
needed and they can be removed.
Convert the ops content logic into generic trip points and register
them with the thermal zone.
In order to consolidate the code, use the ACPI thermal framework API
to fill the generic trip point from the ACPI tables.
It has been tested on a Intel i7-8650U - x280 with the INT3400, the
PCH, ACPITZ, and x86_pkg_temp. No regression observed so far.
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
---
V3:
- The driver Kconfig option selects CONFIG_THERMAL_ACPI
---
drivers/thermal/intel/Kconfig | 1 +
drivers/thermal/intel/intel_pch_thermal.c | 88 +++++--------------
----
2 files changed, 20 insertions(+), 69 deletions(-)
diff --git a/drivers/thermal/intel/Kconfig
b/drivers/thermal/intel/Kconfig
index f0c845679250..738b88b290f4 100644
--- a/drivers/thermal/intel/Kconfig
+++ b/drivers/thermal/intel/Kconfig
@@ -75,6 +75,7 @@ config INTEL_BXT_PMIC_THERMAL
config INTEL_PCH_THERMAL
tristate "Intel PCH Thermal Reporting Driver"
depends on X86 && PCI
+ select THERMAL_ACPI
THERMAL_ACPI depends on ACPI but the PCH thermal driver does not.
So we will run into "unmet dependencies" issue when CONFIG_ACPI is
cleared like below
WARNING: unmet direct dependencies detected for THERMAL_ACPI
Depends on [n]: THERMAL [=y] && ACPI [=n]
Selected by [m]:
- INTEL_PCH_THERMAL [=m] && THERMAL [=y] && (X86 [=y] ||
X86_INTEL_QUARK [=n] || COMPILE_TEST [=n]) && X86 [=y] && PCI [=y]