Skip to content

Commit 3d88348

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
Pull more thermal managament updates from Zhang Rui: "Specifics: - Exynos thermal driver refactoring. Several cleanups, code optimization, unused symbols removal, and unused feature removal in Exynos thermal driver. Thanks Lukasz for this effort. - Exynos thermal driver support to OF thermal. After the code refactoring, the driver earned the support to OF thermal. Chip thermal data were moved from driver code to DTS, reducing the code footprint. Thanks Lukasz for this. - After receiving the OF thermal support, the exynos thermal driver now must allow modular build. Thanks Arnd for detecting, reporting and fixing this. - Exynos thermal driver support to Exynos 7 SoC. Thanks Abhilash for this. - Accurate temperature reporting on Rockchip thermal driver, thanks to Caesar. - Fix on how OF thermal enables its zones, thanks Lukasz for fixing. - Fixes in OF thermal examples under Documentation/. Thanks Srinivas for fixing" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: exynos: Add TMU support for Exynos7 SoC dts: Documentation: Add documentation for Exynos7 SoC thermal bindings cpufreq: exynos: allow modular build thermal: Fix examples in DT documentation thermal: exynos: Correct sanity check at exynos_report_trigger() function thermal: Kconfig: Remove config for not used EXYNOS_THERMAL_CORE thermal: exynos: Remove exynos_tmu_data.c file thermal: rockchip: make temperature reporting much more accurate thermal: exynos: Remove exynos_thermal_common.[c|h] files thermal: samsung: core: Exynos TMU rework to use device tree for configuration dts: Documentation: Update exynos-thermal.txt example for Exynos5440 dts: Documentation: Extending documentation entry for exynos-thermal cpufreq: exynos: Use device tree to determine if cpufreq cooling should be registered thermal: exynos: Modify exynos thermal code to use device tree for cpu cooling configuration thermal: exynos: Provide thermal_exynos.h file to be included in device tree files thermal: exynos: cosmetic: Correct comment format thermal: of: Enable thermal_zoneX when sensor is correctly added
2 parents e3a1f6c + 6c24739 commit 3d88348

File tree

15 files changed

+596
-1090
lines changed

15 files changed

+596
-1090
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"samsung,exynos5420-tmu-ext-triminfo" for TMU channels 2, 3 and 4
1313
Exynos5420 (Must pass triminfo base and triminfo clock)
1414
"samsung,exynos5440-tmu"
15+
"samsung,exynos7-tmu"
1516
- interrupt-parent : The phandle for the interrupt controller
1617
- reg : Address range of the thermal registers. For soc's which has multiple
1718
instances of TMU and some registers are shared across all TMU's like
@@ -32,13 +33,28 @@
3233
- clocks : The main clocks for TMU device
3334
-- 1. operational clock for TMU channel
3435
-- 2. optional clock to access the shared registers of TMU channel
36+
-- 3. optional special clock for functional operation
3537
- clock-names : Thermal system clock name
3638
-- "tmu_apbif" operational clock for current TMU channel
3739
-- "tmu_triminfo_apbif" clock to access the shared triminfo register
3840
for current TMU channel
41+
-- "tmu_sclk" clock for functional operation of the current TMU
42+
channel
3943
- vtmu-supply: This entry is optional and provides the regulator node supplying
4044
voltage to TMU. If needed this entry can be placed inside
4145
board/platform specific dts file.
46+
Following properties are mandatory (depending on SoC):
47+
- samsung,tmu_gain: Gain value for internal TMU operation.
48+
- samsung,tmu_reference_voltage: Value of TMU IP block's reference voltage
49+
- samsung,tmu_noise_cancel_mode: Mode for noise cancellation
50+
- samsung,tmu_efuse_value: Default level of temperature - it is needed when
51+
in factory fusing produced wrong value
52+
- samsung,tmu_min_efuse_value: Minimum temperature fused value
53+
- samsung,tmu_max_efuse_value: Maximum temperature fused value
54+
- samsung,tmu_first_point_trim: First point trimming value
55+
- samsung,tmu_second_point_trim: Second point trimming value
56+
- samsung,tmu_default_temp_offset: Default temperature offset
57+
- samsung,tmu_cal_type: Callibration type
4258

4359
Example 1):
4460

@@ -51,6 +67,7 @@ Example 1):
5167
clock-names = "tmu_apbif";
5268
status = "disabled";
5369
vtmu-supply = <&tmu_regulator_node>;
70+
#include "exynos4412-tmu-sensor-conf.dtsi"
5471
};
5572

5673
Example 2):
@@ -61,6 +78,7 @@ Example 2):
6178
interrupts = <0 58 0>;
6279
clocks = <&clock 21>;
6380
clock-names = "tmu_apbif";
81+
#include "exynos5440-tmu-sensor-conf.dtsi"
6482
};
6583

6684
Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register")
@@ -70,6 +88,7 @@ Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register")
7088
interrupts = <0 184 0>;
7189
clocks = <&clock 318>, <&clock 318>;
7290
clock-names = "tmu_apbif", "tmu_triminfo_apbif";
91+
#include "exynos4412-tmu-sensor-conf.dtsi"
7392
};
7493

7594
tmu_cpu3: tmu@1006c000 {
@@ -78,6 +97,7 @@ Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register")
7897
interrupts = <0 185 0>;
7998
clocks = <&clock 318>, <&clock 319>;
8099
clock-names = "tmu_apbif", "tmu_triminfo_apbif";
100+
#include "exynos4412-tmu-sensor-conf.dtsi"
81101
};
82102

83103
tmu_gpu: tmu@100a0000 {
@@ -86,6 +106,7 @@ Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register")
86106
interrupts = <0 215 0>;
87107
clocks = <&clock 319>, <&clock 318>;
88108
clock-names = "tmu_apbif", "tmu_triminfo_apbif";
109+
#include "exynos4412-tmu-sensor-conf.dtsi"
89110
};
90111

91112
Note: For multi-instance tmu each instance should have an alias correctly

Documentation/devicetree/bindings/thermal/thermal.txt

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -251,24 +251,24 @@ ocp {
251251
};
252252

253253
thermal-zones {
254-
cpu-thermal: cpu-thermal {
254+
cpu_thermal: cpu-thermal {
255255
polling-delay-passive = <250>; /* milliseconds */
256256
polling-delay = <1000>; /* milliseconds */
257257

258258
thermal-sensors = <&bandgap0>;
259259

260260
trips {
261-
cpu-alert0: cpu-alert {
261+
cpu_alert0: cpu-alert0 {
262262
temperature = <90000>; /* millicelsius */
263263
hysteresis = <2000>; /* millicelsius */
264264
type = "active";
265265
};
266-
cpu-alert1: cpu-alert {
266+
cpu_alert1: cpu-alert1 {
267267
temperature = <100000>; /* millicelsius */
268268
hysteresis = <2000>; /* millicelsius */
269269
type = "passive";
270270
};
271-
cpu-crit: cpu-crit {
271+
cpu_crit: cpu-crit {
272272
temperature = <125000>; /* millicelsius */
273273
hysteresis = <2000>; /* millicelsius */
274274
type = "critical";
@@ -277,17 +277,17 @@ thermal-zones {
277277

278278
cooling-maps {
279279
map0 {
280-
trip = <&cpu-alert0>;
281-
cooling-device = <&fan0 THERMAL_NO_LIMITS 4>;
280+
trip = <&cpu_alert0>;
281+
cooling-device = <&fan0 THERMAL_NO_LIMIT 4>;
282282
};
283283
map1 {
284-
trip = <&cpu-alert1>;
285-
cooling-device = <&fan0 5 THERMAL_NO_LIMITS>;
284+
trip = <&cpu_alert1>;
285+
cooling-device = <&fan0 5 THERMAL_NO_LIMIT>;
286286
};
287287
map2 {
288-
trip = <&cpu-alert1>;
288+
trip = <&cpu_alert1>;
289289
cooling-device =
290-
<&cpu0 THERMAL_NO_LIMITS THERMAL_NO_LIMITS>;
290+
<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
291291
};
292292
};
293293
};
@@ -298,13 +298,13 @@ used to monitor the zone 'cpu-thermal' using its sole sensor. A fan
298298
device (fan0) is controlled via I2C bus 1, at address 0x48, and has ten
299299
different cooling states 0-9. It is used to remove the heat out of
300300
the thermal zone 'cpu-thermal' using its cooling states
301-
from its minimum to 4, when it reaches trip point 'cpu-alert0'
301+
from its minimum to 4, when it reaches trip point 'cpu_alert0'
302302
at 90C, as an example of active cooling. The same cooling device is used at
303-
'cpu-alert1', but from 5 to its maximum state. The cpu@0 device is also
303+
'cpu_alert1', but from 5 to its maximum state. The cpu@0 device is also
304304
linked to the same thermal zone, 'cpu-thermal', as a passive cooling device,
305-
using all its cooling states at trip point 'cpu-alert1',
305+
using all its cooling states at trip point 'cpu_alert1',
306306
which is a trip point at 100C. On the thermal zone 'cpu-thermal', at the
307-
temperature of 125C, represented by the trip point 'cpu-crit', the silicon
307+
temperature of 125C, represented by the trip point 'cpu_crit', the silicon
308308
is not reliable anymore.
309309

310310
(b) - IC with several internal sensors
@@ -329,7 +329,7 @@ ocp {
329329
};
330330

331331
thermal-zones {
332-
cpu-thermal: cpu-thermal {
332+
cpu_thermal: cpu-thermal {
333333
polling-delay-passive = <250>; /* milliseconds */
334334
polling-delay = <1000>; /* milliseconds */
335335

@@ -338,12 +338,12 @@ thermal-zones {
338338

339339
trips {
340340
/* each zone within the SoC may have its own trips */
341-
cpu-alert: cpu-alert {
341+
cpu_alert: cpu-alert {
342342
temperature = <100000>; /* millicelsius */
343343
hysteresis = <2000>; /* millicelsius */
344344
type = "passive";
345345
};
346-
cpu-crit: cpu-crit {
346+
cpu_crit: cpu-crit {
347347
temperature = <125000>; /* millicelsius */
348348
hysteresis = <2000>; /* millicelsius */
349349
type = "critical";
@@ -356,7 +356,7 @@ thermal-zones {
356356
};
357357
};
358358

359-
gpu-thermal: gpu-thermal {
359+
gpu_thermal: gpu-thermal {
360360
polling-delay-passive = <120>; /* milliseconds */
361361
polling-delay = <1000>; /* milliseconds */
362362

@@ -365,12 +365,12 @@ thermal-zones {
365365

366366
trips {
367367
/* each zone within the SoC may have its own trips */
368-
gpu-alert: gpu-alert {
368+
gpu_alert: gpu-alert {
369369
temperature = <90000>; /* millicelsius */
370370
hysteresis = <2000>; /* millicelsius */
371371
type = "passive";
372372
};
373-
gpu-crit: gpu-crit {
373+
gpu_crit: gpu-crit {
374374
temperature = <105000>; /* millicelsius */
375375
hysteresis = <2000>; /* millicelsius */
376376
type = "critical";
@@ -383,7 +383,7 @@ thermal-zones {
383383
};
384384
};
385385

386-
dsp-thermal: dsp-thermal {
386+
dsp_thermal: dsp-thermal {
387387
polling-delay-passive = <50>; /* milliseconds */
388388
polling-delay = <1000>; /* milliseconds */
389389

@@ -392,12 +392,12 @@ thermal-zones {
392392

393393
trips {
394394
/* each zone within the SoC may have its own trips */
395-
dsp-alert: gpu-alert {
395+
dsp_alert: dsp-alert {
396396
temperature = <90000>; /* millicelsius */
397397
hysteresis = <2000>; /* millicelsius */
398398
type = "passive";
399399
};
400-
dsp-crit: gpu-crit {
400+
dsp_crit: gpu-crit {
401401
temperature = <135000>; /* millicelsius */
402402
hysteresis = <2000>; /* millicelsius */
403403
type = "critical";
@@ -457,7 +457,7 @@ ocp {
457457
};
458458

459459
thermal-zones {
460-
cpu-thermal: cpu-thermal {
460+
cpu_thermal: cpu-thermal {
461461
polling-delay-passive = <250>; /* milliseconds */
462462
polling-delay = <1000>; /* milliseconds */
463463

@@ -508,7 +508,7 @@ with many sensors and many cooling devices.
508508
/*
509509
* An IC with several temperature sensor.
510510
*/
511-
adc-dummy: sensor@0x50 {
511+
adc_dummy: sensor@0x50 {
512512
...
513513
#thermal-sensor-cells = <1>; /* sensor internal ID */
514514
};
@@ -520,7 +520,7 @@ thermal-zones {
520520
polling-delay = <2500>; /* milliseconds */
521521

522522
/* sensor ID */
523-
thermal-sensors = <&adc-dummy 4>;
523+
thermal-sensors = <&adc_dummy 4>;
524524

525525
trips {
526526
...
@@ -531,14 +531,14 @@ thermal-zones {
531531
};
532532
};
533533

534-
board-thermal: board-thermal {
534+
board_thermal: board-thermal {
535535
polling-delay-passive = <1000>; /* milliseconds */
536536
polling-delay = <2500>; /* milliseconds */
537537

538538
/* sensor ID */
539-
thermal-sensors = <&adc-dummy 0>, /* pcb top edge */
540-
<&adc-dummy 1>, /* lcd */
541-
<&adc-dymmy 2>; /* back cover */
539+
thermal-sensors = <&adc_dummy 0>, /* pcb top edge */
540+
<&adc_dummy 1>, /* lcd */
541+
<&adc_dummy 2>; /* back cover */
542542
/*
543543
* An array of coefficients describing the sensor
544544
* linear relation. E.g.:
@@ -548,22 +548,22 @@ thermal-zones {
548548

549549
trips {
550550
/* Trips are based on resulting linear equation */
551-
cpu-trip: cpu-trip {
551+
cpu_trip: cpu-trip {
552552
temperature = <60000>; /* millicelsius */
553553
hysteresis = <2000>; /* millicelsius */
554554
type = "passive";
555555
};
556-
gpu-trip: gpu-trip {
556+
gpu_trip: gpu-trip {
557557
temperature = <55000>; /* millicelsius */
558558
hysteresis = <2000>; /* millicelsius */
559559
type = "passive";
560560
}
561-
lcd-trip: lcp-trip {
561+
lcd_trip: lcp-trip {
562562
temperature = <53000>; /* millicelsius */
563563
hysteresis = <2000>; /* millicelsius */
564564
type = "passive";
565565
};
566-
crit-trip: crit-trip {
566+
crit_trip: crit-trip {
567567
temperature = <68000>; /* millicelsius */
568568
hysteresis = <2000>; /* millicelsius */
569569
type = "critical";
@@ -572,17 +572,17 @@ thermal-zones {
572572

573573
cooling-maps {
574574
map0 {
575-
trip = <&cpu-trip>;
575+
trip = <&cpu_trip>;
576576
cooling-device = <&cpu0 0 2>;
577577
contribution = <55>;
578578
};
579579
map1 {
580-
trip = <&gpu-trip>;
580+
trip = <&gpu_trip>;
581581
cooling-device = <&gpu0 0 2>;
582582
contribution = <20>;
583583
};
584584
map2 {
585-
trip = <&lcd-trip>;
585+
trip = <&lcd_trip>;
586586
cooling-device = <&lcd0 5 10>;
587587
contribution = <15>;
588588
};

drivers/cpufreq/Kconfig.arm

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,21 @@ config ARM_VEXPRESS_SPC_CPUFREQ
2626

2727

2828
config ARM_EXYNOS_CPUFREQ
29-
bool
29+
tristate "SAMSUNG EXYNOS CPUfreq Driver"
30+
depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250
31+
depends on THERMAL
32+
help
33+
This adds the CPUFreq driver for Samsung EXYNOS platforms.
34+
Supported SoC versions are:
35+
Exynos4210, Exynos4212, Exynos4412, and Exynos5250.
36+
37+
If in doubt, say N.
3038

3139
config ARM_EXYNOS4210_CPUFREQ
3240
bool "SAMSUNG EXYNOS4210"
3341
depends on CPU_EXYNOS4210
42+
depends on ARM_EXYNOS_CPUFREQ
3443
default y
35-
select ARM_EXYNOS_CPUFREQ
3644
help
3745
This adds the CPUFreq driver for Samsung EXYNOS4210
3846
SoC (S5PV310 or S5PC210).
@@ -42,8 +50,8 @@ config ARM_EXYNOS4210_CPUFREQ
4250
config ARM_EXYNOS4X12_CPUFREQ
4351
bool "SAMSUNG EXYNOS4x12"
4452
depends on SOC_EXYNOS4212 || SOC_EXYNOS4412
53+
depends on ARM_EXYNOS_CPUFREQ
4554
default y
46-
select ARM_EXYNOS_CPUFREQ
4755
help
4856
This adds the CPUFreq driver for Samsung EXYNOS4X12
4957
SoC (EXYNOS4212 or EXYNOS4412).
@@ -53,28 +61,14 @@ config ARM_EXYNOS4X12_CPUFREQ
5361
config ARM_EXYNOS5250_CPUFREQ
5462
bool "SAMSUNG EXYNOS5250"
5563
depends on SOC_EXYNOS5250
64+
depends on ARM_EXYNOS_CPUFREQ
5665
default y
57-
select ARM_EXYNOS_CPUFREQ
5866
help
5967
This adds the CPUFreq driver for Samsung EXYNOS5250
6068
SoC.
6169

6270
If in doubt, say N.
6371

64-
config ARM_EXYNOS5440_CPUFREQ
65-
bool "SAMSUNG EXYNOS5440"
66-
depends on SOC_EXYNOS5440
67-
depends on HAVE_CLK && OF
68-
select PM_OPP
69-
default y
70-
help
71-
This adds the CPUFreq driver for Samsung EXYNOS5440
72-
SoC. The nature of exynos5440 clock controller is
73-
different than previous exynos controllers so not using
74-
the common exynos framework.
75-
76-
If in doubt, say N.
77-
7872
config ARM_EXYNOS_CPU_FREQ_BOOST_SW
7973
bool "EXYNOS Frequency Overclocking - Software"
8074
depends on ARM_EXYNOS_CPUFREQ && THERMAL
@@ -90,6 +84,20 @@ config ARM_EXYNOS_CPU_FREQ_BOOST_SW
9084

9185
If in doubt, say N.
9286

87+
config ARM_EXYNOS5440_CPUFREQ
88+
tristate "SAMSUNG EXYNOS5440"
89+
depends on SOC_EXYNOS5440
90+
depends on HAVE_CLK && OF
91+
select PM_OPP
92+
default y
93+
help
94+
This adds the CPUFreq driver for Samsung EXYNOS5440
95+
SoC. The nature of exynos5440 clock controller is
96+
different than previous exynos controllers so not using
97+
the common exynos framework.
98+
99+
If in doubt, say N.
100+
93101
config ARM_HIGHBANK_CPUFREQ
94102
tristate "Calxeda Highbank-based"
95103
depends on ARCH_HIGHBANK && CPUFREQ_DT && REGULATOR

0 commit comments

Comments
 (0)