Skip to content

Commit f475079

Browse files
committed
thermal: ACPI: Move the ACPI thermal library to drivers/acpi/
The ACPI thermal library contains functions that can be used to retrieve trip point temperature values through the platform firmware for various types of trip points. Each of these functions basically evaluates a specific ACPI object, checks if the value produced by it is reasonable and returns it (or THERMAL_TEMP_INVALID if anything fails). It made sense to hold it in drivers/thermal/ so long as it was only used by the code in that directory, but since it is also going to be used by the ACPI thermal driver located in drivers/acpi/, move it to the latter in order to keep the code related to evaluating ACPI objects defined in the specification proper together. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 98b1cc8 commit f475079

File tree

9 files changed

+15
-14
lines changed

9 files changed

+15
-14
lines changed

drivers/acpi/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ config ACPI_CCA_REQUIRED
6161
config ACPI_TABLE_LIB
6262
bool
6363

64+
config ACPI_THERMAL_LIB
65+
depends on THERMAL
66+
bool
67+
6468
config ACPI_DEBUGGER
6569
bool "AML debugger interface"
6670
select ACPI_DEBUG
@@ -327,6 +331,7 @@ config ACPI_THERMAL
327331
tristate "Thermal Zone"
328332
depends on ACPI_PROCESSOR
329333
select THERMAL
334+
select ACPI_THERMAL_LIB
330335
default y
331336
help
332337
This driver supports ACPI thermal zones. Most mobile and

drivers/acpi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ obj-$(CONFIG_ACPI_TAD) += acpi_tad.o
8989
obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o
9090
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
9191
obj-$(CONFIG_ACPI) += container.o
92+
obj-$(CONFIG_ACPI_THERMAL_LIB) += thermal_lib.o
9293
obj-$(CONFIG_ACPI_THERMAL) += thermal.o
9394
obj-$(CONFIG_ACPI_PLATFORM_PROFILE) += platform_profile.o
9495
obj-$(CONFIG_ACPI_NFIT) += nfit/
File renamed without changes.

drivers/thermal/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ config THERMAL_OF
7676
Say 'Y' here if you need to build thermal infrastructure
7777
based on device tree.
7878

79-
config THERMAL_ACPI
80-
depends on ACPI
81-
bool
82-
8379
config THERMAL_WRITABLE_TRIPS
8480
bool "Enable writable trip points"
8581
help

drivers/thermal/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ thermal_sys-$(CONFIG_THERMAL_NETLINK) += thermal_netlink.o
1313
# interface to/from other layers providing sensors
1414
thermal_sys-$(CONFIG_THERMAL_HWMON) += thermal_hwmon.o
1515
thermal_sys-$(CONFIG_THERMAL_OF) += thermal_of.o
16-
thermal_sys-$(CONFIG_THERMAL_ACPI) += thermal_acpi.o
1716

1817
# governors
1918
CFLAGS_gov_power_allocator.o := -I$(src)

drivers/thermal/intel/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ config INTEL_BXT_PMIC_THERMAL
8585
config INTEL_PCH_THERMAL
8686
tristate "Intel PCH Thermal Reporting Driver"
8787
depends on X86 && PCI
88-
select THERMAL_ACPI if ACPI
88+
select ACPI_THERMAL_LIB if ACPI
8989
help
9090
Enable this to support thermal reporting on certain intel PCHs.
9191
Thermal reporting device will provide temperature reading,

drivers/thermal/intel/int340x_thermal/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config INT340X_THERMAL
99
select THERMAL_GOV_USER_SPACE
1010
select ACPI_THERMAL_REL
1111
select ACPI_FAN
12-
select THERMAL_ACPI
12+
select ACPI_THERMAL_LIB
1313
select INTEL_SOC_DTS_IOSF_CORE
1414
select INTEL_TCC
1515
select PROC_THERMAL_MMIO_RAPL if POWERCAP

include/linux/acpi.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ extern int acpi_blacklisted(void);
424424
extern void acpi_osi_setup(char *str);
425425
extern bool acpi_osi_is_win8(void);
426426

427+
#ifdef CONFIG_ACPI_THERMAL_LIB
428+
int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp);
429+
int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp);
430+
int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp);
431+
int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp);
432+
#endif
433+
427434
#ifdef CONFIG_ACPI_NUMA
428435
int acpi_map_pxm_to_node(int pxm);
429436
int acpi_get_node(acpi_handle handle);

include/linux/thermal.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,6 @@ int thermal_zone_get_num_trips(struct thermal_zone_device *tz);
294294

295295
int thermal_zone_get_crit_temp(struct thermal_zone_device *tz, int *temp);
296296

297-
#ifdef CONFIG_THERMAL_ACPI
298-
int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp);
299-
int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp);
300-
int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp);
301-
int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp);
302-
#endif
303-
304297
#ifdef CONFIG_THERMAL
305298
struct thermal_zone_device *thermal_zone_device_register_with_trips(
306299
const char *type,

0 commit comments

Comments
 (0)