aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/configs/mini2440_defconfig2
-rw-r--r--arch/arm/configs/pxa_defconfig2
-rw-r--r--arch/mips/configs/ip22_defconfig2
-rw-r--r--arch/mips/configs/ip27_defconfig2
-rw-r--r--arch/unicore32/configs/unicore32_defconfig2
-rw-r--r--drivers/hwmon/hwmon.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/Kconfig1
-rw-r--r--drivers/thermal/Kconfig8
-rw-r--r--drivers/thermal/intel/Kconfig1
-rw-r--r--drivers/thermal/intel/int340x_thermal/int3403_thermal.c16
-rw-r--r--drivers/thermal/intel/int340x_thermal/processor_thermal_device.c13
-rw-r--r--drivers/thermal/qcom/Kconfig1
-rw-r--r--drivers/thermal/thermal_core.c31
-rw-r--r--include/linux/thermal.h6
14 files changed, 34 insertions, 57 deletions
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig
index 8b0f7c4c3f09..7d26ca0b1302 100644
--- a/arch/arm/configs/mini2440_defconfig
+++ b/arch/arm/configs/mini2440_defconfig
@@ -152,7 +152,7 @@ CONFIG_SPI_S3C24XX=y
152CONFIG_SPI_SPIDEV=y 152CONFIG_SPI_SPIDEV=y
153CONFIG_GPIO_SYSFS=y 153CONFIG_GPIO_SYSFS=y
154CONFIG_SENSORS_LM75=y 154CONFIG_SENSORS_LM75=y
155CONFIG_THERMAL=m 155CONFIG_THERMAL=y
156CONFIG_WATCHDOG=y 156CONFIG_WATCHDOG=y
157CONFIG_S3C2410_WATCHDOG=y 157CONFIG_S3C2410_WATCHDOG=y
158CONFIG_FB=y 158CONFIG_FB=y
diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig
index f6d24d762a7f..07ebbdce3645 100644
--- a/arch/arm/configs/pxa_defconfig
+++ b/arch/arm/configs/pxa_defconfig
@@ -387,7 +387,7 @@ CONFIG_SENSORS_LM75=m
387CONFIG_SENSORS_LM90=m 387CONFIG_SENSORS_LM90=m
388CONFIG_SENSORS_LM95245=m 388CONFIG_SENSORS_LM95245=m
389CONFIG_SENSORS_NTC_THERMISTOR=m 389CONFIG_SENSORS_NTC_THERMISTOR=m
390CONFIG_THERMAL=m 390CONFIG_THERMAL=y
391CONFIG_WATCHDOG=y 391CONFIG_WATCHDOG=y
392CONFIG_XILINX_WATCHDOG=m 392CONFIG_XILINX_WATCHDOG=m
393CONFIG_SA1100_WATCHDOG=m 393CONFIG_SA1100_WATCHDOG=m
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index ff40fbc2f439..21a1168ae301 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -228,7 +228,7 @@ CONFIG_SERIAL_IP22_ZILOG=m
228# CONFIG_HW_RANDOM is not set 228# CONFIG_HW_RANDOM is not set
229CONFIG_RAW_DRIVER=m 229CONFIG_RAW_DRIVER=m
230# CONFIG_HWMON is not set 230# CONFIG_HWMON is not set
231CONFIG_THERMAL=m 231CONFIG_THERMAL=y
232CONFIG_WATCHDOG=y 232CONFIG_WATCHDOG=y
233CONFIG_INDYDOG=m 233CONFIG_INDYDOG=m
234# CONFIG_VGA_CONSOLE is not set 234# CONFIG_VGA_CONSOLE is not set
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 81c47e18131b..54db5dedf776 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -271,7 +271,7 @@ CONFIG_I2C_PARPORT_LIGHT=m
271CONFIG_I2C_TAOS_EVM=m 271CONFIG_I2C_TAOS_EVM=m
272CONFIG_I2C_STUB=m 272CONFIG_I2C_STUB=m
273# CONFIG_HWMON is not set 273# CONFIG_HWMON is not set
274CONFIG_THERMAL=m 274CONFIG_THERMAL=y
275CONFIG_MFD_PCF50633=m 275CONFIG_MFD_PCF50633=m
276CONFIG_PCF50633_ADC=m 276CONFIG_PCF50633_ADC=m
277CONFIG_PCF50633_GPIO=m 277CONFIG_PCF50633_GPIO=m
diff --git a/arch/unicore32/configs/unicore32_defconfig b/arch/unicore32/configs/unicore32_defconfig
index aebd01fc28e5..360cc9abcdb0 100644
--- a/arch/unicore32/configs/unicore32_defconfig
+++ b/arch/unicore32/configs/unicore32_defconfig
@@ -119,7 +119,7 @@ CONFIG_I2C_PUV3=y
119# Hardware Monitoring support 119# Hardware Monitoring support
120#CONFIG_SENSORS_LM75=m 120#CONFIG_SENSORS_LM75=m
121# Generic Thermal sysfs driver 121# Generic Thermal sysfs driver
122#CONFIG_THERMAL=m 122#CONFIG_THERMAL=y
123#CONFIG_THERMAL_HWMON=y 123#CONFIG_THERMAL_HWMON=y
124 124
125# Multimedia support 125# Multimedia support
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index cd91510a5387..e694c46ff039 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -118,9 +118,7 @@ static DEFINE_IDA(hwmon_ida);
118 * The complex conditional is necessary to avoid a cyclic dependency 118 * The complex conditional is necessary to avoid a cyclic dependency
119 * between hwmon and thermal_sys modules. 119 * between hwmon and thermal_sys modules.
120 */ 120 */
121#if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ 121#ifdef CONFIG_THERMAL_OF
122 (!defined(CONFIG_THERMAL_HWMON) || \
123 !(defined(MODULE) && IS_MODULE(CONFIG_THERMAL)))
124static int hwmon_thermal_get_temp(void *data, int *temp) 122static int hwmon_thermal_get_temp(void *data, int *temp)
125{ 123{
126 struct hwmon_thermal_data *tdata = data; 124 struct hwmon_thermal_data *tdata = data;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/Kconfig b/drivers/net/ethernet/mellanox/mlxsw/Kconfig
index b6b3ff0fe17f..7ccb950aa7d4 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlxsw/Kconfig
@@ -22,7 +22,6 @@ config MLXSW_CORE_HWMON
22config MLXSW_CORE_THERMAL 22config MLXSW_CORE_THERMAL
23 bool "Thermal zone support for Mellanox Technologies Switch ASICs" 23 bool "Thermal zone support for Mellanox Technologies Switch ASICs"
24 depends on MLXSW_CORE && THERMAL 24 depends on MLXSW_CORE && THERMAL
25 depends on !(MLXSW_CORE=y && THERMAL=m)
26 default y 25 default y
27 ---help--- 26 ---help---
28 Say Y here if you want to automatically control fans speed according 27 Say Y here if you want to automatically control fans speed according
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 66a709d5d6b9..15bdd25780be 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -3,7 +3,7 @@
3# 3#
4 4
5menuconfig THERMAL 5menuconfig THERMAL
6 tristate "Generic Thermal sysfs driver" 6 bool "Generic Thermal sysfs driver"
7 help 7 help
8 Generic Thermal Sysfs driver offers a generic mechanism for 8 Generic Thermal Sysfs driver offers a generic mechanism for
9 thermal management. Usually it's made up of one or more thermal 9 thermal management. Usually it's made up of one or more thermal
@@ -11,7 +11,7 @@ menuconfig THERMAL
11 Each thermal zone contains its own temperature, trip points, 11 Each thermal zone contains its own temperature, trip points,
12 cooling devices. 12 cooling devices.
13 All platforms with ACPI thermal support can use this driver. 13 All platforms with ACPI thermal support can use this driver.
14 If you want this support, you should say Y or M here. 14 If you want this support, you should say Y here.
15 15
16if THERMAL 16if THERMAL
17 17
@@ -24,7 +24,6 @@ config THERMAL_STATISTICS
24 24
25config THERMAL_EMERGENCY_POWEROFF_DELAY_MS 25config THERMAL_EMERGENCY_POWEROFF_DELAY_MS
26 int "Emergency poweroff delay in milli-seconds" 26 int "Emergency poweroff delay in milli-seconds"
27 depends on THERMAL
28 default 0 27 default 0
29 help 28 help
30 Thermal subsystem will issue a graceful shutdown when 29 Thermal subsystem will issue a graceful shutdown when
@@ -149,10 +148,9 @@ config THERMAL_GOV_POWER_ALLOCATOR
149 allocating and limiting power to devices. 148 allocating and limiting power to devices.
150 149
151config CPU_THERMAL 150config CPU_THERMAL
152 bool "generic cpu cooling support" 151 bool "Generic cpu cooling support"
153 depends on CPU_FREQ 152 depends on CPU_FREQ
154 depends on THERMAL_OF 153 depends on THERMAL_OF
155 depends on THERMAL=y
156 help 154 help
157 This implements the generic cpu cooling mechanism through frequency 155 This implements the generic cpu cooling mechanism through frequency
158 reduction. An ACPI version of this already exists 156 reduction. An ACPI version of this already exists
diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig
index 2e013eeb4a1d..2c727a820759 100644
--- a/drivers/thermal/intel/Kconfig
+++ b/drivers/thermal/intel/Kconfig
@@ -1,6 +1,5 @@
1config INTEL_POWERCLAMP 1config INTEL_POWERCLAMP
2 tristate "Intel PowerClamp idle injection driver" 2 tristate "Intel PowerClamp idle injection driver"
3 depends on THERMAL
4 depends on X86 3 depends on X86
5 depends on CPU_SUP_INTEL 4 depends on CPU_SUP_INTEL
6 help 5 help
diff --git a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c
index 0c19fcd56a0d..79a7df2baa92 100644
--- a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c
@@ -220,6 +220,7 @@ static int int3403_add(struct platform_device *pdev)
220{ 220{
221 struct int3403_priv *priv; 221 struct int3403_priv *priv;
222 int result = 0; 222 int result = 0;
223 unsigned long long tmp;
223 acpi_status status; 224 acpi_status status;
224 225
225 priv = devm_kzalloc(&pdev->dev, sizeof(struct int3403_priv), 226 priv = devm_kzalloc(&pdev->dev, sizeof(struct int3403_priv),
@@ -234,19 +235,18 @@ static int int3403_add(struct platform_device *pdev)
234 goto err; 235 goto err;
235 } 236 }
236 237
237 status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
238 NULL, &priv->type);
239 if (ACPI_FAILURE(status)) {
240 unsigned long long tmp;
241 238
242 status = acpi_evaluate_integer(priv->adev->handle, "_TMP", 239 status = acpi_evaluate_integer(priv->adev->handle, "_TMP",
243 NULL, &tmp); 240 NULL, &tmp);
241 if (ACPI_FAILURE(status)) {
242 status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
243 NULL, &priv->type);
244 if (ACPI_FAILURE(status)) { 244 if (ACPI_FAILURE(status)) {
245 result = -EINVAL; 245 result = -EINVAL;
246 goto err; 246 goto err;
247 } else {
248 priv->type = INT3403_TYPE_SENSOR;
249 } 247 }
248 } else {
249 priv->type = INT3403_TYPE_SENSOR;
250 } 250 }
251 251
252 platform_set_drvdata(pdev, priv); 252 platform_set_drvdata(pdev, priv);
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
index 8e1cf4d789be..2e6071a82da2 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
@@ -81,22 +81,13 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
81 struct device_attribute *attr, \ 81 struct device_attribute *attr, \
82 char *buf) \ 82 char *buf) \
83{ \ 83{ \
84 struct pci_dev *pci_dev; \ 84 struct proc_thermal_device *proc_dev = dev_get_drvdata(dev); \
85 struct platform_device *pdev; \
86 struct proc_thermal_device *proc_dev; \
87 \ 85 \
88 if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \ 86 if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
89 dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \ 87 dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \
90 return 0; \ 88 return 0; \
91 } \ 89 } \
92 \ 90 \
93 if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
94 pdev = to_platform_device(dev); \
95 proc_dev = platform_get_drvdata(pdev); \
96 } else { \
97 pci_dev = to_pci_dev(dev); \
98 proc_dev = pci_get_drvdata(pci_dev); \
99 } \
100 return sprintf(buf, "%lu\n",\ 91 return sprintf(buf, "%lu\n",\
101 (unsigned long)proc_dev->power_limits[index].suffix * 1000); \ 92 (unsigned long)proc_dev->power_limits[index].suffix * 1000); \
102} 93}
@@ -274,7 +265,7 @@ static void proc_thermal_notify(acpi_handle handle, u32 event, void *data)
274 THERMAL_DEVICE_POWER_CAPABILITY_CHANGED); 265 THERMAL_DEVICE_POWER_CAPABILITY_CHANGED);
275 break; 266 break;
276 default: 267 default:
277 dev_err(proc_priv->dev, "Unsupported event [0x%x]\n", event); 268 dev_dbg(proc_priv->dev, "Unsupported event [0x%x]\n", event);
278 break; 269 break;
279 } 270 }
280} 271}
diff --git a/drivers/thermal/qcom/Kconfig b/drivers/thermal/qcom/Kconfig
index cdb455ffd575..3ce20fec86a2 100644
--- a/drivers/thermal/qcom/Kconfig
+++ b/drivers/thermal/qcom/Kconfig
@@ -1,6 +1,5 @@
1config QCOM_TSENS 1config QCOM_TSENS
2 tristate "Qualcomm TSENS Temperature Alarm" 2 tristate "Qualcomm TSENS Temperature Alarm"
3 depends on THERMAL
4 depends on QCOM_QFPROM 3 depends on QCOM_QFPROM
5 depends on ARCH_QCOM || COMPILE_TEST 4 depends on ARCH_QCOM || COMPILE_TEST
6 help 5 help
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index e0b530603db6..46cfb7de4eb2 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -266,7 +266,7 @@ static int __init thermal_register_governors(void)
266 return thermal_gov_power_allocator_register(); 266 return thermal_gov_power_allocator_register();
267} 267}
268 268
269static void thermal_unregister_governors(void) 269static void __init thermal_unregister_governors(void)
270{ 270{
271 thermal_gov_step_wise_unregister(); 271 thermal_gov_step_wise_unregister();
272 thermal_gov_fair_share_unregister(); 272 thermal_gov_fair_share_unregister();
@@ -941,7 +941,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
941 */ 941 */
942static struct thermal_cooling_device * 942static struct thermal_cooling_device *
943__thermal_cooling_device_register(struct device_node *np, 943__thermal_cooling_device_register(struct device_node *np,
944 char *type, void *devdata, 944 const char *type, void *devdata,
945 const struct thermal_cooling_device_ops *ops) 945 const struct thermal_cooling_device_ops *ops)
946{ 946{
947 struct thermal_cooling_device *cdev; 947 struct thermal_cooling_device *cdev;
@@ -1015,7 +1015,7 @@ __thermal_cooling_device_register(struct device_node *np,
1015 * ERR_PTR. Caller must check return value with IS_ERR*() helpers. 1015 * ERR_PTR. Caller must check return value with IS_ERR*() helpers.
1016 */ 1016 */
1017struct thermal_cooling_device * 1017struct thermal_cooling_device *
1018thermal_cooling_device_register(char *type, void *devdata, 1018thermal_cooling_device_register(const char *type, void *devdata,
1019 const struct thermal_cooling_device_ops *ops) 1019 const struct thermal_cooling_device_ops *ops)
1020{ 1020{
1021 return __thermal_cooling_device_register(NULL, type, devdata, ops); 1021 return __thermal_cooling_device_register(NULL, type, devdata, ops);
@@ -1039,7 +1039,7 @@ EXPORT_SYMBOL_GPL(thermal_cooling_device_register);
1039 */ 1039 */
1040struct thermal_cooling_device * 1040struct thermal_cooling_device *
1041thermal_of_cooling_device_register(struct device_node *np, 1041thermal_of_cooling_device_register(struct device_node *np,
1042 char *type, void *devdata, 1042 const char *type, void *devdata,
1043 const struct thermal_cooling_device_ops *ops) 1043 const struct thermal_cooling_device_ops *ops)
1044{ 1044{
1045 return __thermal_cooling_device_register(np, type, devdata, ops); 1045 return __thermal_cooling_device_register(np, type, devdata, ops);
@@ -1543,6 +1543,7 @@ static int thermal_pm_notify(struct notifier_block *nb,
1543 unsigned long mode, void *_unused) 1543 unsigned long mode, void *_unused)
1544{ 1544{
1545 struct thermal_zone_device *tz; 1545 struct thermal_zone_device *tz;
1546 enum thermal_device_mode tz_mode;
1546 1547
1547 switch (mode) { 1548 switch (mode) {
1548 case PM_HIBERNATION_PREPARE: 1549 case PM_HIBERNATION_PREPARE:
@@ -1555,6 +1556,13 @@ static int thermal_pm_notify(struct notifier_block *nb,
1555 case PM_POST_SUSPEND: 1556 case PM_POST_SUSPEND:
1556 atomic_set(&in_suspend, 0); 1557 atomic_set(&in_suspend, 0);
1557 list_for_each_entry(tz, &thermal_tz_list, node) { 1558 list_for_each_entry(tz, &thermal_tz_list, node) {
1559 tz_mode = THERMAL_DEVICE_ENABLED;
1560 if (tz->ops->get_mode)
1561 tz->ops->get_mode(tz, &tz_mode);
1562
1563 if (tz_mode == THERMAL_DEVICE_DISABLED)
1564 continue;
1565
1558 thermal_zone_device_init(tz); 1566 thermal_zone_device_init(tz);
1559 thermal_zone_device_update(tz, 1567 thermal_zone_device_update(tz,
1560 THERMAL_EVENT_UNSPECIFIED); 1568 THERMAL_EVENT_UNSPECIFIED);
@@ -1612,19 +1620,4 @@ error:
1612 mutex_destroy(&poweroff_lock); 1620 mutex_destroy(&poweroff_lock);
1613 return result; 1621 return result;
1614} 1622}
1615
1616static void __exit thermal_exit(void)
1617{
1618 unregister_pm_notifier(&thermal_pm_nb);
1619 of_thermal_destroy_zones();
1620 genetlink_exit();
1621 class_unregister(&thermal_class);
1622 thermal_unregister_governors();
1623 ida_destroy(&thermal_tz_ida);
1624 ida_destroy(&thermal_cdev_ida);
1625 mutex_destroy(&thermal_list_lock);
1626 mutex_destroy(&thermal_governor_lock);
1627}
1628
1629fs_initcall(thermal_init); 1623fs_initcall(thermal_init);
1630module_exit(thermal_exit);
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 4a22099ed8c0..15a4ca5d7099 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -442,10 +442,10 @@ void thermal_zone_device_update(struct thermal_zone_device *,
442 enum thermal_notify_event); 442 enum thermal_notify_event);
443void thermal_zone_set_trips(struct thermal_zone_device *); 443void thermal_zone_set_trips(struct thermal_zone_device *);
444 444
445struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 445struct thermal_cooling_device *thermal_cooling_device_register(const char *,
446 const struct thermal_cooling_device_ops *); 446 void *, const struct thermal_cooling_device_ops *);
447struct thermal_cooling_device * 447struct thermal_cooling_device *
448thermal_of_cooling_device_register(struct device_node *np, char *, void *, 448thermal_of_cooling_device_register(struct device_node *np, const char *, void *,
449 const struct thermal_cooling_device_ops *); 449 const struct thermal_cooling_device_ops *);
450struct thermal_cooling_device * 450struct thermal_cooling_device *
451devm_thermal_of_cooling_device_register(struct device *dev, 451devm_thermal_of_cooling_device_register(struct device *dev,