Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPI: DPTF: Remove int340x thermal scan handler

Using the IS_ENABLED() macro in the int340x_thermal_handler_attach()
forces the kernel to be recompiled when thermal drivers are enabled
or disabled, which is a significant limitation of its modularity.

The IS_ENABLED() macro is particularly problematic for the Android
Generic Kernel Image (GKI) project which uses unified core kernel
while SoC/board support is moved to loadable vendor modules.

The Intel Dynamic Platform and Thermal Framework (DPTF) requires
thermal drivers to be loaded at runtime, thus ACPI bus scan handler
is not needed and acpi_default_enumeration() may create all platform
devices, regardless of the actual setting of CONFIG_INT340X_THERMAL.

Signed-off-by: Slawomir Rosek <srosek@google.com>
Link: https://patch.msgid.link/20251103162516.2606158-3-srosek@google.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Slawomir Rosek and committed by
Rafael J. Wysocki
966c9e65 13a96342

-92
-1
drivers/acpi/dptf/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - obj-$(CONFIG_ACPI) += int340x_thermal.o 3 2 obj-$(CONFIG_DPTF_POWER) += dptf_power.o 4 3 obj-$(CONFIG_DPTF_PCH_FIVR) += dptf_pch_fivr.o
-89
drivers/acpi/dptf/int340x_thermal.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * ACPI support for int340x thermal drivers 4 - * 5 - * Copyright (C) 2014, Intel Corporation 6 - * Authors: Zhang Rui <rui.zhang@intel.com> 7 - */ 8 - 9 - #include <linux/acpi.h> 10 - #include <linux/module.h> 11 - 12 - #include "../internal.h" 13 - 14 - static const struct acpi_device_id int340x_thermal_device_ids[] = { 15 - {"INT3400"}, 16 - {"INT3401"}, 17 - {"INT3402"}, 18 - {"INT3403"}, 19 - {"INT3404"}, 20 - {"INT3406"}, 21 - {"INT3407"}, 22 - {"INT3408"}, 23 - {"INT3409"}, 24 - {"INT340A"}, 25 - {"INT340B"}, 26 - {"INT3532"}, 27 - {"INTC1040"}, 28 - {"INTC1041"}, 29 - {"INTC1042"}, 30 - {"INTC1043"}, 31 - {"INTC1044"}, 32 - {"INTC1045"}, 33 - {"INTC1046"}, 34 - {"INTC1047"}, 35 - {"INTC1048"}, 36 - {"INTC1049"}, 37 - {"INTC1050"}, 38 - {"INTC1060"}, 39 - {"INTC1061"}, 40 - {"INTC1062"}, 41 - {"INTC1063"}, 42 - {"INTC1064"}, 43 - {"INTC1065"}, 44 - {"INTC1066"}, 45 - {"INTC1068"}, 46 - {"INTC1069"}, 47 - {"INTC106A"}, 48 - {"INTC106B"}, 49 - {"INTC106C"}, 50 - {"INTC106D"}, 51 - {"INTC10A0"}, 52 - {"INTC10A1"}, 53 - {"INTC10A2"}, 54 - {"INTC10A3"}, 55 - {"INTC10A4"}, 56 - {"INTC10A5"}, 57 - {"INTC10D4"}, 58 - {"INTC10D5"}, 59 - {"INTC10D6"}, 60 - {"INTC10D7"}, 61 - {"INTC10D8"}, 62 - {"INTC10D9"}, 63 - {"INTC10FC"}, 64 - {"INTC10FD"}, 65 - {"INTC10FE"}, 66 - {"INTC10FF"}, 67 - {"INTC1100"}, 68 - {"INTC1101"}, 69 - {"INTC1102"}, 70 - {""}, 71 - }; 72 - 73 - static int int340x_thermal_handler_attach(struct acpi_device *adev, 74 - const struct acpi_device_id *id) 75 - { 76 - if (IS_ENABLED(CONFIG_INT340X_THERMAL)) 77 - acpi_create_platform_device(adev, NULL); 78 - return 1; 79 - } 80 - 81 - static struct acpi_scan_handler int340x_thermal_handler = { 82 - .ids = int340x_thermal_device_ids, 83 - .attach = int340x_thermal_handler_attach, 84 - }; 85 - 86 - void __init acpi_int340x_thermal_init(void) 87 - { 88 - acpi_scan_add_handler(&int340x_thermal_handler); 89 - }
-1
drivers/acpi/internal.h
··· 27 27 void acpi_processor_init(void); 28 28 void acpi_platform_init(void); 29 29 void acpi_pnp_init(void); 30 - void acpi_int340x_thermal_init(void); 31 30 int acpi_sysfs_init(void); 32 31 void acpi_gpe_apply_masked_gpes(void); 33 32 void acpi_container_init(void);
-1
drivers/acpi/scan.c
··· 2711 2711 acpi_watchdog_init(); 2712 2712 acpi_pnp_init(); 2713 2713 acpi_power_resources_init(); 2714 - acpi_int340x_thermal_init(); 2715 2714 acpi_init_lpit(); 2716 2715 2717 2716 acpi_scan_add_handler(&generic_device_handler);