Skip to content

Commit b32b5e1

Browse files
committed
Merge branches 'thermal-core', 'thermal-soc', 'thermal-intel' and 'const-thermal-zone-structure' into next
4 parents 9d9ca1f + 7a34879 + 9ef08d7 + 28e6c99 commit b32b5e1

21 files changed

+702
-90
lines changed

Documentation/devicetree/bindings/thermal/mediatek-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Required properties:
1111
- compatible:
1212
- "mediatek,mt8173-thermal" : For MT8173 family of SoCs
1313
- "mediatek,mt2701-thermal" : For MT2701 family of SoCs
14+
- "mediatek,mt2712-thermal" : For MT2712 family of SoCs
1415
- reg: Address range of the thermal controller
1516
- interrupts: IRQ for the thermal controller
1617
- clocks, clock-names: Clocks needed for the thermal controller. required

Documentation/devicetree/bindings/thermal/rockchip-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Required properties:
44
- compatible : should be "rockchip,<name>-tsadc"
55
"rockchip,rk3228-tsadc": found on RK3228 SoCs
66
"rockchip,rk3288-tsadc": found on RK3288 SoCs
7+
"rockchip,rk3328-tsadc": found on RK3328 SoCs
78
"rockchip,rk3368-tsadc": found on RK3368 SoCs
89
"rockchip,rk3399-tsadc": found on RK3399 SoCs
910
- reg : physical base address of the controller and length of memory mapped
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
* UniPhier Thermal bindings
2+
3+
This describes the devicetree bindings for thermal monitor supported by
4+
PVT(Process, Voltage and Temperature) monitoring unit implemented on Socionext
5+
UniPhier SoCs.
6+
7+
Required properties:
8+
- compatible :
9+
- "socionext,uniphier-pxs2-thermal" : For UniPhier PXs2 SoC
10+
- "socionext,uniphier-ld20-thermal" : For UniPhier LD20 SoC
11+
- interrupts : IRQ for the temperature alarm
12+
- #thermal-sensor-cells : Should be 0. See ./thermal.txt for details.
13+
14+
Optional properties:
15+
- socionext,tmod-calibration: A pair of calibrated values referred from PVT,
16+
in case that the values aren't set on SoC,
17+
like a reference board.
18+
19+
Example:
20+
21+
sysctrl@61840000 {
22+
compatible = "socionext,uniphier-ld20-sysctrl",
23+
"simple-mfd", "syscon";
24+
reg = <0x61840000 0x10000>;
25+
...
26+
pvtctl: pvtctl {
27+
compatible = "socionext,uniphier-ld20-thermal";
28+
interrupts = <0 3 1>;
29+
#thermal-sensor-cells = <0>;
30+
};
31+
...
32+
};
33+
34+
thermal-zones {
35+
cpu_thermal {
36+
polling-delay-passive = <250>; /* 250ms */
37+
polling-delay = <1000>; /* 1000ms */
38+
thermal-sensors = <&pvtctl>;
39+
40+
trips {
41+
cpu_crit: cpu_crit {
42+
temperature = <110000>; /* 110C */
43+
hysteresis = <2000>;
44+
type = "critical";
45+
};
46+
cpu_alert: cpu_alert {
47+
temperature = <100000>; /* 100C */
48+
hysteresis = <2000>;
49+
type = "passive";
50+
};
51+
};
52+
53+
cooling-maps {
54+
map0 {
55+
trip = <&cpu_alert>;
56+
cooling-device = <&cpu0 (-1) (-1)>;
57+
};
58+
map1 {
59+
trip = <&cpu_alert>;
60+
cooling-device = <&cpu2 (-1) (-1)>;
61+
};
62+
};
63+
};
64+
};

drivers/thermal/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ config X86_PKG_TEMP_THERMAL
342342

343343
config INTEL_SOC_DTS_IOSF_CORE
344344
tristate
345-
depends on X86
345+
depends on X86 && PCI
346346
select IOSF_MBI
347347
help
348348
This is becoming a common feature for Intel SoCs to expose the additional
@@ -352,7 +352,7 @@ config INTEL_SOC_DTS_IOSF_CORE
352352

353353
config INTEL_SOC_DTS_THERMAL
354354
tristate "Intel SoCs DTS thermal driver"
355-
depends on X86
355+
depends on X86 && PCI
356356
select INTEL_SOC_DTS_IOSF_CORE
357357
select THERMAL_WRITABLE_TRIPS
358358
help
@@ -473,4 +473,12 @@ config ZX2967_THERMAL
473473
the primitive temperature sensor embedded in zx2967 SoCs.
474474
This sensor generates the real time die temperature.
475475

476+
config UNIPHIER_THERMAL
477+
tristate "Socionext UniPhier thermal driver"
478+
depends on ARCH_UNIPHIER || COMPILE_TEST
479+
depends on THERMAL_OF && MFD_SYSCON
480+
help
481+
Enable this to plug in UniPhier on-chip PVT thermal driver into the
482+
thermal framework. The driver supports CPU thermal zone temperature
483+
reporting and a couple of trip points.
476484
endif

drivers/thermal/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o
5959
obj-$(CONFIG_MTK_THERMAL) += mtk_thermal.o
6060
obj-$(CONFIG_GENERIC_ADC_THERMAL) += thermal-generic-adc.o
6161
obj-$(CONFIG_ZX2967_THERMAL) += zx2967_thermal.o
62+
obj-$(CONFIG_UNIPHIER_THERMAL) += uniphier_thermal.o

drivers/thermal/broadcom/bcm2835_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
145145
debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
146146
}
147147

148-
static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
148+
static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
149149
.get_temp = bcm2835_thermal_get_temp,
150150
};
151151

drivers/thermal/hisi_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static int hisi_thermal_get_temp(void *_sensor, int *temp)
206206
return 0;
207207
}
208208

209-
static struct thermal_zone_of_device_ops hisi_of_thermal_ops = {
209+
static const struct thermal_zone_of_device_ops hisi_of_thermal_ops = {
210210
.get_temp = hisi_thermal_get_temp,
211211
};
212212

drivers/thermal/int340x_thermal/acpi_thermal_rel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static void get_single_name(acpi_handle handle, char *name)
228228
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER};
229229

230230
if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)))
231-
pr_warn("Failed get name from handle\n");
231+
pr_warn("Failed to get device name from acpi handle\n");
232232
else {
233233
memcpy(name, buffer.pointer, ACPI_NAME_SIZE);
234234
kfree(buffer.pointer);

drivers/thermal/int340x_thermal/acpi_thermal_rel.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ struct trt {
3434
acpi_handle target;
3535
u64 influence;
3636
u64 sample_period;
37-
u64 reverved1;
38-
u64 reverved2;
39-
u64 reverved3;
40-
u64 reverved4;
37+
u64 reserved1;
38+
u64 reserved2;
39+
u64 reserved3;
40+
u64 reserved4;
4141
} __packed;
4242

4343
#define ACPI_NR_ART_ELEMENTS 13

drivers/thermal/int340x_thermal/int3400_thermal.c

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/thermal.h>
1717
#include "acpi_thermal_rel.h"
1818

19+
#define INT3400_THERMAL_TABLE_CHANGED 0x83
20+
1921
enum int3400_thermal_uuid {
2022
INT3400_THERMAL_PASSIVE_1,
2123
INT3400_THERMAL_ACTIVE,
@@ -104,7 +106,7 @@ static struct attribute *uuid_attrs[] = {
104106
NULL
105107
};
106108

107-
static struct attribute_group uuid_attribute_group = {
109+
static const struct attribute_group uuid_attribute_group = {
108110
.attrs = uuid_attrs,
109111
.name = "uuids"
110112
};
@@ -185,6 +187,35 @@ static int int3400_thermal_run_osc(acpi_handle handle,
185187
return result;
186188
}
187189

190+
static void int3400_notify(acpi_handle handle,
191+
u32 event,
192+
void *data)
193+
{
194+
struct int3400_thermal_priv *priv = data;
195+
char *thermal_prop[5];
196+
197+
if (!priv)
198+
return;
199+
200+
switch (event) {
201+
case INT3400_THERMAL_TABLE_CHANGED:
202+
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s",
203+
priv->thermal->type);
204+
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d",
205+
priv->thermal->temperature);
206+
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
207+
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d",
208+
THERMAL_TABLE_CHANGED);
209+
thermal_prop[4] = NULL;
210+
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE,
211+
thermal_prop);
212+
break;
213+
default:
214+
dev_err(&priv->adev->dev, "Unsupported event [0x%x]\n", event);
215+
break;
216+
}
217+
}
218+
188219
static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
189220
int *temp)
190221
{
@@ -290,6 +321,12 @@ static int int3400_thermal_probe(struct platform_device *pdev)
290321
if (result)
291322
goto free_zone;
292323

324+
result = acpi_install_notify_handler(
325+
priv->adev->handle, ACPI_DEVICE_NOTIFY, int3400_notify,
326+
(void *)priv);
327+
if (result)
328+
goto free_zone;
329+
293330
return 0;
294331

295332
free_zone:
@@ -306,6 +343,10 @@ static int int3400_thermal_remove(struct platform_device *pdev)
306343
{
307344
struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
308345

346+
acpi_remove_notify_handler(
347+
priv->adev->handle, ACPI_DEVICE_NOTIFY,
348+
int3400_notify);
349+
309350
if (!priv->rel_misc_dev_res)
310351
acpi_thermal_rel_misc_device_remove(priv->adev->handle);
311352

0 commit comments

Comments
 (0)