History

Merge tag 'thermal-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull thermal control updates from Rafael Wysocki: "These extend the thermal trip point crossing notifications sent via netlink to contain the temperature causing the trip point to be crossed, deprecate the user space thermal governor, add new DT bindings to drivers, move ABI documentation to Documentation/ABI, fix assorted issues and clean up code. Specifics: - Constify a variable in thermal MMIO driver (Rikard Falkeborn). - Add the current temperature in the netlink message when crossing a trip point in order to prevent useless back and forth reading from userspace (Daniel Lezcano). - Add support for the 'HC' variant on PM8998 PMIC in order to support VADC channels on recent QCom boards (Bjorn Andersson). - Add support for calibration values from hardware when they are fused (Niklas Söderlund). - Fix NULL pointer dereference in the thermal_release callback when an error occurs in the thermal_zone_device_register() (Yuanzheng Song). - Fix use-after-free in __thermal_cooling_device_register() in the error path (Ziyang Xuan). - Fix compilation of the LMh driver when CONFIG_QCOM_SCM is not set (Jackie Liu). - Add timeout when reading a register that can block forever in certain circumstances in the tsens driver (Ansuel Smith). - Add DT binding for the reset lines and use them in the rockchip sensor driver (Johan Jonker). - Add new uniphier NX1 SoC temperature sensor (Kunihiko Hayashi). - Save and restore the TCC value in the int340x driver (Antoine Tenart). - Deprecate the writability of the cooling device state sysfs file and the user space governor (Daniel Lezcano). - Delete bogus length check in int340x (Dan Carpenter). - Use bitmap_zalloc/bitmap_free when applicable in intel_powerclamp (Christophe JAILLET). - Move thermal ABI documentation to Documentation/ABI (Mauro Carvalho Chehab)" * tag 'thermal-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (21 commits) thermal/core: Deprecate changing cooling device state from userspace thermal/core: Make the userspace governor deprecated thermal/drivers/int340x: Improve the tcc offset saving for suspend/resume thermal/drivers/uniphier: Add compatible string for NX1 SoC dt-bindings: thermal: uniphier: Add binding for NX1 SoC thermal/drivers/rockchip_thermal: Allow more resets for tsadc node dt-bindings: thermal: remove redundant comments from rockchip-thermal.yaml dt-bindings: thermal: allow more resets for tsadc node in rockchip-thermal.yaml thermal/drivers/tsens: Add timeout to get_temp_tsens_valid thermal/drivers/qcom/lmh: make QCOM_LMH depends on QCOM_SCM thermal/core: fix a UAF bug in __thermal_cooling_device_register() thermal/core: Fix null pointer dereference in thermal_release() thermal: rcar_gen3_thermal: Read calibration from hardware thermal: rcar_gen3_thermal: Store thcode and ptat in priv data thermal/drivers/qcom/spmi-adc-tm5: Add support for HC variant dt-bindings: thermal: qcom: add HC variant of adc-thermal monitor bindings thermal: Move ABI documentation to Documentation/ABI thermal/drivers/netlink: Add the temperature when crossing a trip point thermal/drivers/thermal_mmio: Constify static struct thermal_mmio_ops thermal: int340x: delete bogus length check ...

Linus Torvalds committed 5 years ago

Commit f73cd9c2 parents 833db72 46e9f9225 files · +679 −314Browse files

Unified · Split

25 files
  1. Documentation/ABI/testing/sysfs-class-thermal +259 −0
  2. Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml +149 −0
  3. Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml +13 −10
  4. Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml +1 −0
  5. Documentation/driver-api/thermal/sysfs-api.rst +3 −222
  6. MAINTAINERS +2 −0
  7. drivers/thermal/gov_user_space.c +9 −0
  8. drivers/thermal/intel/int340x_thermal/int3400_thermal.c +4 −5
  9. drivers/thermal/intel/int340x_thermal/int3401_thermal.c +7 −1
  10. drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +28 −8
  11. drivers/thermal/intel/int340x_thermal/processor_thermal_device.h +1 −0
  12. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +17 −1
  13. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c +7 −1
  14. drivers/thermal/intel/intel_powerclamp.c +3 −5
  15. drivers/thermal/qcom/Kconfig +1 −1
  16. drivers/thermal/qcom/qcom-spmi-adc-tm5.c +40 −1
  17. drivers/thermal/qcom/tsens.c +14 −15
  18. drivers/thermal/rcar_gen3_thermal.c +86 −27
  19. drivers/thermal/rockchip_thermal.c +1 −1
  20. drivers/thermal/thermal_core.c +16 −6
  21. drivers/thermal/thermal_mmio.c +1 −1
  22. drivers/thermal/thermal_netlink.c +6 −5
  23. drivers/thermal/thermal_netlink.h +4 −4
  24. drivers/thermal/thermal_sysfs.c +3 −0
  25. drivers/thermal/uniphier_thermal.c +4 −0
Documentation/ABI/testing/sysfs-class-thermal+259−0
@@ -0,0 +1,259 @@
1What: /sys/class/thermal/thermal_zoneX/type
2Description:
3 Strings which represent the thermal zone type.
4 This is given by thermal zone driver as part of registration.
5 E.g: "acpitz" indicates it's an ACPI thermal device.
6 In order to keep it consistent with hwmon sys attribute; this
7 shouldbe a short, lowercase string, not containing spaces nor
8 dashes.
9
10 RO, Required
11
12What: /sys/class/thermal/thermal_zoneX/temp
13Description:
14 Current temperature as reported by thermal zone (sensor).
15
16 Unit: millidegree Celsius
17
18 RO, Required
19
20What: /sys/class/thermal/thermal_zoneX/mode
21Description:
22 One of the predefined values in [enabled, disabled].
23 This file gives information about the algorithm that is
24 currently managing the thermal zone. It can be either default
25 kernel based algorithm or user space application.
26
27 enabled
28 enable Kernel Thermal management.
29 disabled
30 Preventing kernel thermal zone driver actions upon
31 trip points so that user application can take full
32 charge of the thermal management.
33
34 RW, Optional
35
36What: /sys/class/thermal/thermal_zoneX/policy
37Description:
38 One of the various thermal governors used for a particular zone.
39
40 RW, Required
41
42What: /sys/class/thermal/thermal_zoneX/available_policies
43Description:
44 Available thermal governors which can be used for a
45 particular zone.
46
47 RO, Required
48
49What: /sys/class/thermal/thermal_zoneX/trip_point_Y_temp
50Description:
51 The temperature above which trip point will be fired.
52
53 Unit: millidegree Celsius
54
55 RO, Optional
56
57What: /sys/class/thermal/thermal_zoneX/trip_point_Y_type
58Description:
59 Strings which indicate the type of the trip point.
60
61 E.g. it can be one of critical, hot, passive, `active[0-*]`
62 for ACPI thermal zone.
63
64 RO, Optional
65
66What: /sys/class/thermal/thermal_zoneX/trip_point_Y_hyst
67Description:
68 The hysteresis value for a trip point, represented as an
69 integer.
70
71 Unit: Celsius
72
73 RW, Optional
74
75What: /sys/class/thermal/thermal_zoneX/cdevY
76Description:
77 Sysfs link to the thermal cooling device node where the sys I/F
78 for cooling device throttling control represents.
79
80 RO, Optional
81
82What: /sys/class/thermal/thermal_zoneX/cdevY_trip_point
83Description:
84 The trip point in this thermal zone which `cdev[0-*]` is
85 associated with; -1 means the cooling device is not
86 associated with any trip point.
87
88 RO, Optional
89
90What: /sys/class/thermal/thermal_zoneX/cdevY_weight
91Description:
92 The influence of `cdev[0-*]` in this thermal zone. This value
93 is relative to the rest of cooling devices in the thermal
94 zone. For example, if a cooling device has a weight double
95 than that of other, it's twice as effective in cooling the
96 thermal zone.
97
98 RW, Optional
99
100What: /sys/class/thermal/thermal_zoneX/emul_temp
101Description:
102 Interface to set the emulated temperature method in thermal zone
103 (sensor). After setting this temperature, the thermal zone may
104 pass this temperature to platform emulation function if
105 registered or cache it locally. This is useful in debugging
106 different temperature threshold and its associated cooling
107 action. This is write only node and writing 0 on this node
108 should disable emulation.
109
110 Unit: millidegree Celsius
111
112 WO, Optional
113
114 WARNING:
115 Be careful while enabling this option on production systems,
116 because userland can easily disable the thermal policy by simply
117 flooding this sysfs node with low temperature values.
118
119
120What: /sys/class/thermal/thermal_zoneX/k_d
121Description:
122 The derivative term of the power allocator governor's PID
123 controller. For more information see
124 Documentation/driver-api/thermal/power_allocator.rst
125
126 RW, Optional
127
128What: /sys/class/thermal/thermal_zoneX/k_i
129Description:
130 The integral term of the power allocator governor's PID
131 controller. This term allows the PID controller to compensate
132 for long term drift. For more information see
133 Documentation/driver-api/thermal/power_allocator.rst
134
135 RW, Optional
136
137What: /sys/class/thermal/thermal_zoneX/k_po
138Description:
139 The proportional term of the power allocator governor's PID
140 controller during temperature overshoot. Temperature overshoot
141 is when the current temperature is above the "desired
142 temperature" trip point. For more information see
143 Documentation/driver-api/thermal/power_allocator.rst
144
145 RW, Optional
146
147What: /sys/class/thermal/thermal_zoneX/k_pu
148Description:
149 The proportional term of the power allocator governor's PID
150 controller during temperature undershoot. Temperature undershoot
151 is when the current temperature is below the "desired
152 temperature" trip point. For more information see
153 Documentation/driver-api/thermal/power_allocator.rst
154
155 RW, Optional
156
157What: /sys/class/thermal/thermal_zoneX/integral_cutoff
158Description:
159 Temperature offset from the desired temperature trip point
160 above which the integral term of the power allocator
161 governor's PID controller starts accumulating errors. For
162 example, if integral_cutoff is 0, then the integral term only
163 accumulates error when temperature is above the desired
164 temperature trip point. For more information see
165 Documentation/driver-api/thermal/power_allocator.rst
166
167 Unit: millidegree Celsius
168
169 RW, Optional
170
171What: /sys/class/thermal/thermal_zoneX/slope
172Description:
173 The slope constant used in a linear extrapolation model
174 to determine a hotspot temperature based off the sensor's
175 raw readings. It is up to the device driver to determine
176 the usage of these values.
177
178 RW, Optional
179
180What: /sys/class/thermal/thermal_zoneX/offset
181Description:
182 The offset constant used in a linear extrapolation model
183 to determine a hotspot temperature based off the sensor's
184 raw readings. It is up to the device driver to determine
185 the usage of these values.
186
187 RW, Optional
188
189What: /sys/class/thermal/thermal_zoneX/sustainable_power
190Description:
191 An estimate of the sustained power that can be dissipated by
192 the thermal zone. Used by the power allocator governor. For
193 more information see
194 Documentation/driver-api/thermal/power_allocator.rst
195
196 Unit: milliwatts
197
198 RW, Optional
199
200What: /sys/class/thermal/cooling_deviceX/type
201Description:
202 String which represents the type of device, e.g:
203
204 - for generic ACPI: should be "Fan", "Processor" or "LCD"
205 - for memory controller device on intel_menlow platform:
206 should be "Memory controller".
207
208 RO, Required
209
210What: /sys/class/thermal/cooling_deviceX/max_state
211Description:
212 The maximum permissible cooling state of this cooling device.
213
214 RO, Required
215
216What: /sys/class/thermal/cooling_deviceX/cur_state
217Description:
218 The current cooling state of this cooling device.
219 The value can any integer numbers between 0 and max_state:
220
221 - cur_state == 0 means no cooling
222 - cur_state == max_state means the maximum cooling.
223
224 RW, Required
225
226What: /sys/class/thermal/cooling_deviceX/stats/reset
227Description:
228 Writing any value resets the cooling device's statistics.
229
230 WO, Required
231
232What: /sys/class/thermal/cooling_deviceX/stats/time_in_state_ms:
233Description:
234 The amount of time spent by the cooling device in various
235 cooling states. The output will have "<state> <time>" pair
236 in each line, which will mean this cooling device spent <time>
237 msec of time at <state>.
238
239 Output will have one line for each of the supported states.
240
241 RO, Required
242
243What: /sys/class/thermal/cooling_deviceX/stats/total_trans
244Description:
245 A single positive value showing the total number of times
246 the state of a cooling device is changed.
247
248 RO, Required
249
250What: /sys/class/thermal/cooling_deviceX/stats/trans_table
251Description:
252 This gives fine grained information about all the cooling state
253 transitions. The cat output here is a two dimensional matrix,
254 where an entry <i,j> (row i, column j) represents the number
255 of transitions from State_i to State_j. If the transition
256 table is bigger than PAGE_SIZE, reading this will return
257 an -EFBIG error.
258
259 RO, Required
Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml+149−0
@@ -0,0 +1,149 @@
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm's SPMI PMIC ADC HC Thermal Monitoring
8maintainers:
9 - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
10
11properties:
12 compatible:
13 const: qcom,spmi-adc-tm-hc
14
15 reg:
16 maxItems: 1
17
18 interrupts:
19 maxItems: 1
20
21 "#thermal-sensor-cells":
22 const: 1
23 description:
24 Number of cells required to uniquely identify the thermal sensors. Since
25 we have multiple sensors this is set to 1
26
27 "#address-cells":
28 const: 1
29
30 "#size-cells":
31 const: 0
32
33 qcom,avg-samples:
34 $ref: /schemas/types.yaml#/definitions/uint32
35 description: Number of samples to be used for measurement.
36 enum:
37 - 1
38 - 2
39 - 4
40 - 8
41 - 16
42 default: 1
43
44 qcom,decimation:
45 $ref: /schemas/types.yaml#/definitions/uint32
46 description: This parameter is used to decrease ADC sampling rate.
47 Quicker measurements can be made by reducing decimation ratio.
48 enum:
49 - 256
50 - 512
51 - 1024
52 default: 1024
53
54patternProperties:
55 "^([-a-z0-9]*)@[0-7]$":
56 type: object
57 description:
58 Represent one thermal sensor.
59
60 properties:
61 reg:
62 description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM
63 minimum: 0
64 maximum: 7
65
66 io-channels:
67 description:
68 From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor
69
70 qcom,ratiometric:
71 $ref: /schemas/types.yaml#/definitions/flag
72 description:
73 Channel calibration type.
74 If this property is specified VADC will use the VDD reference
75 (1.875V) and GND for channel calibration. If property is not found,
76 channel will be calibrated with 0V and 1.25V reference channels,
77 also known as absolute calibration.
78
79 qcom,hw-settle-time-us:
80 description: Time between AMUX getting configured and the ADC starting conversion.
81 enum: [0, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 6000, 8000, 10000]
82
83 qcom,pre-scaling:
84 $ref: /schemas/types.yaml#/definitions/uint32-array
85 description: Used for scaling the channel input signal before the
86 signal is fed to VADC. The configuration for this node is to know the
87 pre-determined ratio and use it for post scaling. It is a pair of
88 integers, denoting the numerator and denominator of the fraction by
89 which input signal is multiplied. For example, <1 3> indicates the
90 signal is scaled down to 1/3 of its value before ADC measurement. If
91 property is not found default value depending on chip will be used.
92 items:
93 - const: 1
94 - enum: [ 1, 3, 4, 6, 20, 8, 10 ]
95
96 required:
97 - reg
98 - io-channels
99
100 additionalProperties:
101 false
102
103required:
104 - compatible
105 - reg
106 - interrupts
107 - "#address-cells"
108 - "#size-cells"
109 - "#thermal-sensor-cells"
110
111additionalProperties: false
112
113examples:
114 - |
115 #include <dt-bindings/iio/qcom,spmi-vadc.h>
116 #include <dt-bindings/interrupt-controller/irq.h>
117 spmi_bus {
118 #address-cells = <1>;
119 #size-cells = <0>;
120 pm8998_adc: adc@3100 {
121 reg = <0x3100>;
122 compatible = "qcom,spmi-adc-rev2";
123 #address-cells = <1>;
124 #size-cells = <0>;
125 #io-channel-cells = <1>;
126
127 /* Other propreties are omitted */
128 adc-chan@4c {
129 reg = <ADC5_XO_THERM_100K_PU>;
130 };
131 };
132
133 pm8998_adc_tm: adc-tm@3400 {
134 compatible = "qcom,spmi-adc-tm-hc";
135 reg = <0x3400>;
136 interrupts = <0x2 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
137 #thermal-sensor-cells = <1>;
138 #address-cells = <1>;
139 #size-cells = <0>;
140
141 thermistor@1 {
142 reg = <1>;
143 io-channels = <&pm8998_adc ADC5_XO_THERM_100K_PU>;
144 qcom,ratiometric;
145 qcom,hw-settle-time-us = <200>;
146 };
147 };
148 };
149...
Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml+13−10
@@ -12,14 +12,14 @@ maintainers: · 11 unmodified lines
12properties:12properties:
13 compatible:13 compatible:
14 enum:14 enum:
15 - rockchip,px30-tsadc # PX30 SoCs15 - rockchip,px30-tsadc
16 - rockchip,rv1108-tsadc # RV1108 SoCs16 - rockchip,rk3228-tsadc
17 - rockchip,rk3228-tsadc # RK3228 SoCs17 - rockchip,rk3288-tsadc
18 - rockchip,rk3288-tsadc # RK3288 SoCs18 - rockchip,rk3328-tsadc
19 - rockchip,rk3328-tsadc # RK3328 SoCs19 - rockchip,rk3368-tsadc
20 - rockchip,rk3368-tsadc # RK3368 SoCs20 - rockchip,rk3399-tsadc
21 - rockchip,rk3399-tsadc # RK3399 SoCs21 - rockchip,rk3568-tsadc
22 - rockchip,rk3568-tsadc # RK3568 SoCs22 - rockchip,rv1108-tsadc
23 23
24 reg:24 reg:
25 maxItems: 125 maxItems: 1
@@ -37,11 +37,15 @@ properties: · 11 unmodified lines
37 - const: apb_pclk37 - const: apb_pclk
38 38
39 resets:39 resets:
40 maxItems: 140 minItems: 1
41 maxItems: 3
41 42
42 reset-names:43 reset-names:
44 minItems: 1
43 items:45 items:
44 - const: tsadc-apb46 - const: tsadc-apb
47 - const: tsadc
48 - const: tsadc-phy
45 49
46 "#thermal-sensor-cells":50 "#thermal-sensor-cells":
47 const: 151 const: 1
@@ -71,7 +75,6 @@ required: · 23 unmodified lines
71 - clocks75 - clocks
72 - clock-names76 - clock-names
73 - resets77 - resets
74 - reset-names
75 - "#thermal-sensor-cells"78 - "#thermal-sensor-cells"
76 79
77additionalProperties: false80additionalProperties: false
Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml+1−0
@@ -20,6 +20,7 @@ properties: · 19 unmodified lines
20 - socionext,uniphier-pxs2-thermal20 - socionext,uniphier-pxs2-thermal
21 - socionext,uniphier-ld20-thermal21 - socionext,uniphier-ld20-thermal
22 - socionext,uniphier-pxs3-thermal22 - socionext,uniphier-pxs3-thermal
23 - socionext,uniphier-nx1-thermal
23 24
24 interrupts:25 interrupts:
25 maxItems: 126 maxItems: 1
Documentation/driver-api/thermal/sysfs-api.rst+3−222
@@ -428,6 +428,9 @@ of thermal zone device. E.g. the generic thermal driver registers one hwmon · 427 unmodified lines
428class device and build the associated hwmon sysfs I/F for all the registered428class device and build the associated hwmon sysfs I/F for all the registered
429ACPI thermal zones.429ACPI thermal zones.
430 430
431Please read Documentation/ABI/testing/sysfs-class-thermal for thermal
432zone and cooling device attribute details.
433
431::434::
432 435
433 /sys/class/hwmon/hwmon[0-*]:436 /sys/class/hwmon/hwmon[0-*]:
@@ -437,228 +440,6 @@ ACPI thermal zones. · 3 unmodified lines
437 440
438Please read Documentation/hwmon/sysfs-interface.rst for additional information.441Please read Documentation/hwmon/sysfs-interface.rst for additional information.
439 442
440Thermal zone attributes
441-----------------------
442
443type
444 Strings which represent the thermal zone type.
445 This is given by thermal zone driver as part of registration.
446 E.g: "acpitz" indicates it's an ACPI thermal device.
447 In order to keep it consistent with hwmon sys attribute; this should
448 be a short, lowercase string, not containing spaces nor dashes.
449 RO, Required
450
451temp
452 Current temperature as reported by thermal zone (sensor).
453 Unit: millidegree Celsius
454 RO, Required
455
456mode
457 One of the predefined values in [enabled, disabled].
458 This file gives information about the algorithm that is currently
459 managing the thermal zone. It can be either default kernel based
460 algorithm or user space application.
461
462 enabled
463 enable Kernel Thermal management.
464 disabled
465 Preventing kernel thermal zone driver actions upon
466 trip points so that user application can take full
467 charge of the thermal management.
468
469 RW, Optional
470
471policy
472 One of the various thermal governors used for a particular zone.
473
474 RW, Required
475
476available_policies
477 Available thermal governors which can be used for a particular zone.
478
479 RO, Required
480
481`trip_point_[0-*]_temp`
482 The temperature above which trip point will be fired.
483
484 Unit: millidegree Celsius
485
486 RO, Optional
487
488`trip_point_[0-*]_type`
489 Strings which indicate the type of the trip point.
490
491 E.g. it can be one of critical, hot, passive, `active[0-*]` for ACPI
492 thermal zone.
493
494 RO, Optional
495
496`trip_point_[0-*]_hyst`
497 The hysteresis value for a trip point, represented as an integer
498 Unit: Celsius
499 RW, Optional
500
501`cdev[0-*]`
502 Sysfs link to the thermal cooling device node where the sys I/F
503 for cooling device throttling control represents.
504
505 RO, Optional
506
507`cdev[0-*]_trip_point`
508 The trip point in this thermal zone which `cdev[0-*]` is associated
509 with; -1 means the cooling device is not associated with any trip
510 point.
511
512 RO, Optional
513
514`cdev[0-*]_weight`
515 The influence of `cdev[0-*]` in this thermal zone. This value
516 is relative to the rest of cooling devices in the thermal
517 zone. For example, if a cooling device has a weight double
518 than that of other, it's twice as effective in cooling the
519 thermal zone.
520
521 RW, Optional
522
523emul_temp
524 Interface to set the emulated temperature method in thermal zone
525 (sensor). After setting this temperature, the thermal zone may pass
526 this temperature to platform emulation function if registered or
527 cache it locally. This is useful in debugging different temperature
528 threshold and its associated cooling action. This is write only node
529 and writing 0 on this node should disable emulation.
530 Unit: millidegree Celsius
531
532 WO, Optional
533
534 WARNING:
535 Be careful while enabling this option on production systems,
536 because userland can easily disable the thermal policy by simply
537 flooding this sysfs node with low temperature values.
538
539sustainable_power
540 An estimate of the sustained power that can be dissipated by
541 the thermal zone. Used by the power allocator governor. For
542 more information see Documentation/driver-api/thermal/power_allocator.rst
543
544 Unit: milliwatts
545
546 RW, Optional
547
548k_po
549 The proportional term of the power allocator governor's PID
550 controller during temperature overshoot. Temperature overshoot
551 is when the current temperature is above the "desired
552 temperature" trip point. For more information see
553 Documentation/driver-api/thermal/power_allocator.rst
554
555 RW, Optional
556
557k_pu
558 The proportional term of the power allocator governor's PID
559 controller during temperature undershoot. Temperature undershoot
560 is when the current temperature is below the "desired
561 temperature" trip point. For more information see
562 Documentation/driver-api/thermal/power_allocator.rst
563
564 RW, Optional
565
566k_i
567 The integral term of the power allocator governor's PID
568 controller. This term allows the PID controller to compensate
569 for long term drift. For more information see
570 Documentation/driver-api/thermal/power_allocator.rst
571
572 RW, Optional
573
574k_d
575 The derivative term of the power allocator governor's PID
576 controller. For more information see
577 Documentation/driver-api/thermal/power_allocator.rst
578
579 RW, Optional
580
581integral_cutoff
582 Temperature offset from the desired temperature trip point
583 above which the integral term of the power allocator
584 governor's PID controller starts accumulating errors. For
585 example, if integral_cutoff is 0, then the integral term only
586 accumulates error when temperature is above the desired
587 temperature trip point. For more information see
588 Documentation/driver-api/thermal/power_allocator.rst
589
590 Unit: millidegree Celsius
591
592 RW, Optional
593
594slope
595 The slope constant used in a linear extrapolation model
596 to determine a hotspot temperature based off the sensor's
597 raw readings. It is up to the device driver to determine
598 the usage of these values.
599
600 RW, Optional
601
602offset
603 The offset constant used in a linear extrapolation model
604 to determine a hotspot temperature based off the sensor's
605 raw readings. It is up to the device driver to determine
606 the usage of these values.
607
608 RW, Optional
609
610Cooling device attributes
611-------------------------
612
613type
614 String which represents the type of device, e.g:
615
616 - for generic ACPI: should be "Fan", "Processor" or "LCD"
617 - for memory controller device on intel_menlow platform:
618 should be "Memory controller".
619
620 RO, Required
621
622max_state
623 The maximum permissible cooling state of this cooling device.
624
625 RO, Required
626
627cur_state
628 The current cooling state of this cooling device.
629 The value can any integer numbers between 0 and max_state:
630
631 - cur_state == 0 means no cooling
632 - cur_state == max_state means the maximum cooling.
633
634 RW, Required
635
636stats/reset
637 Writing any value resets the cooling device's statistics.
638 WO, Required
639
640stats/time_in_state_ms:
641 The amount of time spent by the cooling device in various cooling
642 states. The output will have "<state> <time>" pair in each line, which
643 will mean this cooling device spent <time> msec of time at <state>.
644 Output will have one line for each of the supported states.
645 RO, Required
646
647
648stats/total_trans:
649 A single positive value showing the total number of times the state of a
650 cooling device is changed.
651
652 RO, Required
653
654stats/trans_table:
655 This gives fine grained information about all the cooling state
656 transitions. The cat output here is a two dimensional matrix, where an
657 entry <i,j> (row i, column j) represents the number of transitions from
658 State_i to State_j. If the transition table is bigger than PAGE_SIZE,
659 reading this will return an -EFBIG error.
660 RO, Required
661
6623. A simple implementation4433. A simple implementation
663==========================444==========================
664 445
MAINTAINERS+2−0
@@ -18649,7 +18649,9 @@ L: linux-pm@vger.kernel.org · 18648 unmodified lines
18649S: Supported18649S: Supported
18650Q: https://patchwork.kernel.org/project/linux-pm/list/18650Q: https://patchwork.kernel.org/project/linux-pm/list/
18651T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal18651T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
18652F: Documentation/ABI/testing/sysfs-class-thermal
18652F: Documentation/devicetree/bindings/thermal/18653F: Documentation/devicetree/bindings/thermal/
18654F: Documentation/driver-api/thermal/
18653F: drivers/thermal/18655F: drivers/thermal/
18654F: include/linux/cpu_cooling.h18656F: include/linux/cpu_cooling.h
18655F: include/linux/thermal.h18657F: include/linux/thermal.h
drivers/thermal/gov_user_space.c+9−0
@@ -15,6 +15,14 @@ · 14 unmodified lines
15 15
16#include "thermal_core.h"16#include "thermal_core.h"
17 17
18static int user_space_bind(struct thermal_zone_device *tz)
19{
20 pr_warn("Userspace governor deprecated: use thermal netlink " \
21 "notification instead\n");
22
23 return 0;
24}
25
18/**26/**
19 * notify_user_space - Notifies user space about thermal events27 * notify_user_space - Notifies user space about thermal events
20 * @tz: thermal_zone_device28 * @tz: thermal_zone_device
@@ -43,5 +51,6 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip) · 22 unmodified lines
43static struct thermal_governor thermal_gov_user_space = {51static struct thermal_governor thermal_gov_user_space = {
44 .name = "user_space",52 .name = "user_space",
45 .throttle = notify_user_space,53 .throttle = notify_user_space,
54 .bind_to_tz = user_space_bind,
46};55};
47THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);56THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);
drivers/thermal/intel/int340x_thermal/int3400_thermal.c+4−5
@@ -129,11 +129,10 @@ static ssize_t available_uuids_show(struct device *dev, · 128 unmodified lines
129 129
130 for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {130 for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
131 if (priv->uuid_bitmap & (1 << i))131 if (priv->uuid_bitmap & (1 << i))
132 if (PAGE_SIZE - length > 0)132 length += scnprintf(&buf[length],
133 length += scnprintf(&buf[length],133 PAGE_SIZE - length,
134 PAGE_SIZE - length,134 "%s\n",
135 "%s\n",135 int3400_thermal_uuids[i]);
136 int3400_thermal_uuids[i]);
137 }136 }
138 137
139 return length;138 return length;
drivers/thermal/intel/int340x_thermal/int3401_thermal.c+7−1
@@ -44,15 +44,21 @@ static int int3401_remove(struct platform_device *pdev) · 43 unmodified lines
44}44}
45 45
46#ifdef CONFIG_PM_SLEEP46#ifdef CONFIG_PM_SLEEP
47static int int3401_thermal_suspend(struct device *dev)
48{
49 return proc_thermal_suspend(dev);
50}
47static int int3401_thermal_resume(struct device *dev)51static int int3401_thermal_resume(struct device *dev)
48{52{
49 return proc_thermal_resume(dev);53 return proc_thermal_resume(dev);
50}54}
51#else55#else
56#define int3401_thermal_suspend NULL
52#define int3401_thermal_resume NULL57#define int3401_thermal_resume NULL
53#endif58#endif
54 59
55static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, NULL, int3401_thermal_resume);60static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, int3401_thermal_suspend,
61 int3401_thermal_resume);
56 62
57static struct platform_driver int3401_driver = {63static struct platform_driver int3401_driver = {
58 .probe = int3401_add,64 .probe = int3401_add,
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c+28−8
@@ -68,8 +68,7 @@ static const struct attribute_group power_limit_attribute_group = { · 67 unmodified lines
68 .name = "power_limits"68 .name = "power_limits"
69};69};
70 70
71static ssize_t tcc_offset_degree_celsius_show(struct device *dev,71static int tcc_get_offset(void)
72 struct device_attribute *attr, char *buf)
73{72{
74 u64 val;73 u64 val;
75 int err;74 int err;
@@ -78,8 +77,20 @@ static ssize_t tcc_offset_degree_celsius_show(struct device *dev, · 2 unmodified lines
78 if (err)77 if (err)
79 return err;78 return err;
80 79
81 val = (val >> 24) & 0x3f;80 return (val >> 24) & 0x3f;
82 return sprintf(buf, "%d\n", (int)val);81}
82
83static ssize_t tcc_offset_degree_celsius_show(struct device *dev,
84 struct device_attribute *attr,
85 char *buf)
86{
87 int tcc;
88
89 tcc = tcc_get_offset();
90 if (tcc < 0)
91 return tcc;
92
93 return sprintf(buf, "%d\n", tcc);
83}94}
84 95
85static int tcc_offset_update(unsigned int tcc)96static int tcc_offset_update(unsigned int tcc)
@@ -107,8 +118,6 @@ static int tcc_offset_update(unsigned int tcc) · 21 unmodified lines
107 return 0;118 return 0;
108}119}
109 120
110static int tcc_offset_save = -1;
111
112static ssize_t tcc_offset_degree_celsius_store(struct device *dev,121static ssize_t tcc_offset_degree_celsius_store(struct device *dev,
113 struct device_attribute *attr, const char *buf,122 struct device_attribute *attr, const char *buf,
114 size_t count)123 size_t count)
@@ -131,8 +140,6 @@ static ssize_t tcc_offset_degree_celsius_store(struct device *dev, · 16 unmodified lines
131 if (err)140 if (err)
132 return err;141 return err;
133 142
134 tcc_offset_save = tcc;
135
136 return count;143 return count;
137}144}
138 145
@@ -345,6 +352,18 @@ void proc_thermal_remove(struct proc_thermal_device *proc_priv) · 206 unmodified lines
345}352}
346EXPORT_SYMBOL_GPL(proc_thermal_remove);353EXPORT_SYMBOL_GPL(proc_thermal_remove);
347 354
355static int tcc_offset_save = -1;
356
357int proc_thermal_suspend(struct device *dev)
358{
359 tcc_offset_save = tcc_get_offset();
360 if (tcc_offset_save < 0)
361 dev_warn(dev, "failed to save offset (%d)\n", tcc_offset_save);
362
363 return 0;
364}
365EXPORT_SYMBOL_GPL(proc_thermal_suspend);
366
348int proc_thermal_resume(struct device *dev)367int proc_thermal_resume(struct device *dev)
349{368{
350 struct proc_thermal_device *proc_dev;369 struct proc_thermal_device *proc_dev;
@@ -352,6 +371,7 @@ int proc_thermal_resume(struct device *dev) · 1 unmodified line
352 proc_dev = dev_get_drvdata(dev);371 proc_dev = dev_get_drvdata(dev);
353 proc_thermal_read_ppcc(proc_dev);372 proc_thermal_read_ppcc(proc_dev);
354 373
374 /* Do not update if saving failed */
355 if (tcc_offset_save >= 0)375 if (tcc_offset_save >= 0)
356 tcc_offset_update(tcc_offset_save);376 tcc_offset_update(tcc_offset_save);
357 377
drivers/thermal/intel/int340x_thermal/processor_thermal_device.h+1−0
@@ -83,6 +83,7 @@ void proc_thermal_mbox_remove(struct pci_dev *pdev); · 82 unmodified lines
83int processor_thermal_send_mbox_cmd(struct pci_dev *pdev, u16 cmd_id, u32 cmd_data, u32 *cmd_resp);83int processor_thermal_send_mbox_cmd(struct pci_dev *pdev, u16 cmd_id, u32 cmd_data, u32 *cmd_resp);
84int proc_thermal_add(struct device *dev, struct proc_thermal_device *priv);84int proc_thermal_add(struct device *dev, struct proc_thermal_device *priv);
85void proc_thermal_remove(struct proc_thermal_device *proc_priv);85void proc_thermal_remove(struct proc_thermal_device *proc_priv);
86int proc_thermal_suspend(struct device *dev);
86int proc_thermal_resume(struct device *dev);87int proc_thermal_resume(struct device *dev);
87int proc_thermal_mmio_add(struct pci_dev *pdev,88int proc_thermal_mmio_add(struct pci_dev *pdev,
88 struct proc_thermal_device *proc_priv,89 struct proc_thermal_device *proc_priv,
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c+17−1
@@ -314,6 +314,20 @@ static void proc_thermal_pci_remove(struct pci_dev *pdev) · 313 unmodified lines
314}314}
315 315
316#ifdef CONFIG_PM_SLEEP316#ifdef CONFIG_PM_SLEEP
317static int proc_thermal_pci_suspend(struct device *dev)
318{
319 struct pci_dev *pdev = to_pci_dev(dev);
320 struct proc_thermal_device *proc_priv;
321 struct proc_thermal_pci *pci_info;
322
323 proc_priv = pci_get_drvdata(pdev);
324 pci_info = proc_priv->priv_data;
325
326 if (!pci_info->no_legacy)
327 return proc_thermal_suspend(dev);
328
329 return 0;
330}
317static int proc_thermal_pci_resume(struct device *dev)331static int proc_thermal_pci_resume(struct device *dev)
318{332{
319 struct pci_dev *pdev = to_pci_dev(dev);333 struct pci_dev *pdev = to_pci_dev(dev);
@@ -335,10 +349,12 @@ static int proc_thermal_pci_resume(struct device *dev) · 15 unmodified lines
335 return 0;349 return 0;
336}350}
337#else351#else
352#define proc_thermal_pci_suspend NULL
338#define proc_thermal_pci_resume NULL353#define proc_thermal_pci_resume NULL
339#endif354#endif
340 355
341static SIMPLE_DEV_PM_OPS(proc_thermal_pci_pm, NULL, proc_thermal_pci_resume);356static SIMPLE_DEV_PM_OPS(proc_thermal_pci_pm, proc_thermal_pci_suspend,
357 proc_thermal_pci_resume);
342 358
343static const struct pci_device_id proc_thermal_pci_ids[] = {359static const struct pci_device_id proc_thermal_pci_ids[] = {
344 { PCI_DEVICE_DATA(INTEL, ADL_THERMAL, PROC_THERMAL_FEATURE_RAPL | PROC_THERMAL_FEATURE_FIVR | PROC_THERMAL_FEATURE_DVFS | PROC_THERMAL_FEATURE_MBOX) },360 { PCI_DEVICE_DATA(INTEL, ADL_THERMAL, PROC_THERMAL_FEATURE_RAPL | PROC_THERMAL_FEATURE_FIVR | PROC_THERMAL_FEATURE_DVFS | PROC_THERMAL_FEATURE_MBOX) },
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c+7−1
@@ -107,15 +107,21 @@ static void proc_thermal_pci_remove(struct pci_dev *pdev) · 106 unmodified lines
107}107}
108 108
109#ifdef CONFIG_PM_SLEEP109#ifdef CONFIG_PM_SLEEP
110static int proc_thermal_pci_suspend(struct device *dev)
111{
112 return proc_thermal_suspend(dev);
113}
110static int proc_thermal_pci_resume(struct device *dev)114static int proc_thermal_pci_resume(struct device *dev)
111{115{
112 return proc_thermal_resume(dev);116 return proc_thermal_resume(dev);
113}117}
114#else118#else
119#define proc_thermal_pci_suspend NULL
115#define proc_thermal_pci_resume NULL120#define proc_thermal_pci_resume NULL
116#endif121#endif
117 122
118static SIMPLE_DEV_PM_OPS(proc_thermal_pci_pm, NULL, proc_thermal_pci_resume);123static SIMPLE_DEV_PM_OPS(proc_thermal_pci_pm, proc_thermal_pci_suspend,
124 proc_thermal_pci_resume);
119 125
120static const struct pci_device_id proc_thermal_pci_ids[] = {126static const struct pci_device_id proc_thermal_pci_ids[] = {
121 { PCI_DEVICE_DATA(INTEL, BDW_THERMAL, 0) },127 { PCI_DEVICE_DATA(INTEL, BDW_THERMAL, 0) },
drivers/thermal/intel/intel_powerclamp.c+3−5
@@ -705,10 +705,8 @@ static enum cpuhp_state hp_state; · 704 unmodified lines
705static int __init powerclamp_init(void)705static int __init powerclamp_init(void)
706{706{
707 int retval;707 int retval;
708 int bitmap_size;
709 708
710 bitmap_size = BITS_TO_LONGS(num_possible_cpus()) * sizeof(long);709 cpu_clamping_mask = bitmap_zalloc(num_possible_cpus(), GFP_KERNEL);
711 cpu_clamping_mask = kzalloc(bitmap_size, GFP_KERNEL);
712 if (!cpu_clamping_mask)710 if (!cpu_clamping_mask)
713 return -ENOMEM;711 return -ENOMEM;
714 712
@@ -753,7 +751,7 @@ exit_free_thread: · 38 unmodified lines
753exit_unregister:751exit_unregister:
754 cpuhp_remove_state_nocalls(hp_state);752 cpuhp_remove_state_nocalls(hp_state);
755exit_free:753exit_free:
756 kfree(cpu_clamping_mask);754 bitmap_free(cpu_clamping_mask);
757 return retval;755 return retval;
758}756}
759module_init(powerclamp_init);757module_init(powerclamp_init);
@@ -764,7 +762,7 @@ static void __exit powerclamp_exit(void) · 4 unmodified lines
764 cpuhp_remove_state_nocalls(hp_state);762 cpuhp_remove_state_nocalls(hp_state);
765 free_percpu(worker_data);763 free_percpu(worker_data);
766 thermal_cooling_device_unregister(cooling_dev);764 thermal_cooling_device_unregister(cooling_dev);
767 kfree(cpu_clamping_mask);765 bitmap_free(cpu_clamping_mask);
768 766
769 cancel_delayed_work_sync(&poll_pkg_cstate_work);767 cancel_delayed_work_sync(&poll_pkg_cstate_work);
770 debugfs_remove_recursive(debug_dir);768 debugfs_remove_recursive(debug_dir);
drivers/thermal/qcom/Kconfig+1−1
@@ -34,7 +34,7 @@ config QCOM_SPMI_TEMP_ALARM · 33 unmodified lines
34 34
35config QCOM_LMH35config QCOM_LMH
36 tristate "Qualcomm Limits Management Hardware"36 tristate "Qualcomm Limits Management Hardware"
37 depends on ARCH_QCOM37 depends on ARCH_QCOM && QCOM_SCM
38 help38 help
39 This enables initialization of Qualcomm limits management39 This enables initialization of Qualcomm limits management
40 hardware(LMh). LMh allows for hardware-enforced mitigation for cpus based on40 hardware(LMh). LMh allows for hardware-enforced mitigation for cpus based on
drivers/thermal/qcom/qcom-spmi-adc-tm5.c+40−1
@@ -82,6 +82,7 @@ struct adc_tm5_data { · 81 unmodified lines
82 const u32 full_scale_code_volt;82 const u32 full_scale_code_volt;
83 unsigned int *decimation;83 unsigned int *decimation;
84 unsigned int *hw_settle;84 unsigned int *hw_settle;
85 bool is_hc;
85};86};
86 87
87enum adc_tm5_cal_method {88enum adc_tm5_cal_method {
@@ -146,6 +147,14 @@ static const struct adc_tm5_data adc_tm5_data_pmic = { · 58 unmodified lines
146 64000, 128000 },147 64000, 128000 },
147};148};
148 149
150static const struct adc_tm5_data adc_tm_hc_data_pmic = {
151 .full_scale_code_volt = 0x70e4,
152 .decimation = (unsigned int []) { 256, 512, 1024 },
153 .hw_settle = (unsigned int []) { 0, 100, 200, 300, 400, 500, 600, 700,
154 1000, 2000, 4000, 6000, 8000, 10000 },
155 .is_hc = true,
156};
157
149static int adc_tm5_read(struct adc_tm5_chip *adc_tm, u16 offset, u8 *data, int len)158static int adc_tm5_read(struct adc_tm5_chip *adc_tm, u16 offset, u8 *data, int len)
150{159{
151 return regmap_bulk_read(adc_tm->regmap, adc_tm->base + offset, data, len);160 return regmap_bulk_read(adc_tm->regmap, adc_tm->base + offset, data, len);
@@ -375,6 +384,29 @@ static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm) · 223 unmodified lines
375 return 0;384 return 0;
376}385}
377 386
387static int adc_tm_hc_init(struct adc_tm5_chip *chip)
388{
389 unsigned int i;
390 u8 buf[2];
391 int ret;
392
393 for (i = 0; i < chip->nchannels; i++) {
394 if (chip->channels[i].channel >= ADC_TM5_NUM_CHANNELS) {
395 dev_err(chip->dev, "Invalid channel %d\n", chip->channels[i].channel);
396 return -EINVAL;
397 }
398 }
399
400 buf[0] = chip->decimation;
401 buf[1] = chip->avg_samples | ADC_TM5_FAST_AVG_EN;
402
403 ret = adc_tm5_write(chip, ADC_TM5_ADC_DIG_PARAM, buf, sizeof(buf));
404 if (ret)
405 dev_err(chip->dev, "block write failed: %d\n", ret);
406
407 return ret;
408}
409
378static int adc_tm5_init(struct adc_tm5_chip *chip)410static int adc_tm5_init(struct adc_tm5_chip *chip)
379{411{
380 u8 buf[4], channels_available;412 u8 buf[4], channels_available;
@@ -591,7 +623,10 @@ static int adc_tm5_probe(struct platform_device *pdev) · 210 unmodified lines
591 return ret;623 return ret;
592 }624 }
593 625
594 ret = adc_tm5_init(adc_tm);626 if (adc_tm->data->is_hc)
627 ret = adc_tm_hc_init(adc_tm);
628 else
629 ret = adc_tm5_init(adc_tm);
595 if (ret) {630 if (ret) {
596 dev_err(dev, "adc-tm init failed\n");631 dev_err(dev, "adc-tm init failed\n");
597 return ret;632 return ret;
@@ -612,6 +647,10 @@ static const struct of_device_id adc_tm5_match_table[] = { · 14 unmodified lines
612 .compatible = "qcom,spmi-adc-tm5",647 .compatible = "qcom,spmi-adc-tm5",
613 .data = &adc_tm5_data_pmic,648 .data = &adc_tm5_data_pmic,
614 },649 },
650 {
651 .compatible = "qcom,spmi-adc-tm-hc",
652 .data = &adc_tm_hc_data_pmic,
653 },
615 { }654 { }
616};655};
617MODULE_DEVICE_TABLE(of, adc_tm5_match_table);656MODULE_DEVICE_TABLE(of, adc_tm5_match_table);
drivers/thermal/qcom/tsens.c+14−15
@@ -603,22 +603,21 @@ int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp) · 602 unmodified lines
603 int ret;603 int ret;
604 604
605 /* VER_0 doesn't have VALID bit */605 /* VER_0 doesn't have VALID bit */
606 if (tsens_version(priv) >= VER_0_1) {606 if (tsens_version(priv) == VER_0)
607 ret = regmap_field_read(priv->rf[valid_idx], &valid);607 goto get_temp;
608 if (ret)608
609 return ret;609 /* Valid bit is 0 for 6 AHB clock cycles.
610 while (!valid) {610 * At 19.2MHz, 1 AHB clock is ~60ns.
611 /* Valid bit is 0 for 6 AHB clock cycles.611 * We should enter this loop very, very rarely.
612 * At 19.2MHz, 1 AHB clock is ~60ns.612 * Wait 1 us since it's the min of poll_timeout macro.
613 * We should enter this loop very, very rarely.613 * Old value was 400 ns.
614 */614 */
615 ndelay(400);615 ret = regmap_field_read_poll_timeout(priv->rf[valid_idx], valid,
616 ret = regmap_field_read(priv->rf[valid_idx], &valid);616 valid, 1, 20 * USEC_PER_MSEC);
617 if (ret)617 if (ret)
618 return ret;618 return ret;
619 }
620 }
621 619
620get_temp:
622 /* Valid bit is set, OK to read the temperature */621 /* Valid bit is set, OK to read the temperature */
623 *temp = tsens_hw_to_mC(s, temp_idx);622 *temp = tsens_hw_to_mC(s, temp_idx);
624 623
drivers/thermal/rcar_gen3_thermal.c+86−27
@@ -34,6 +34,10 @@ · 33 unmodified lines
34#define REG_GEN3_THCODE1 0x5034#define REG_GEN3_THCODE1 0x50
35#define REG_GEN3_THCODE2 0x5435#define REG_GEN3_THCODE2 0x54
36#define REG_GEN3_THCODE3 0x5836#define REG_GEN3_THCODE3 0x58
37#define REG_GEN3_PTAT1 0x5c
38#define REG_GEN3_PTAT2 0x60
39#define REG_GEN3_PTAT3 0x64
40#define REG_GEN3_THSCP 0x68
37 41
38/* IRQ{STR,MSK,EN} bits */42/* IRQ{STR,MSK,EN} bits */
39#define IRQ_TEMP1 BIT(0)43#define IRQ_TEMP1 BIT(0)
@@ -55,6 +59,9 @@ · 15 unmodified lines
55#define THCTR_PONM BIT(6)59#define THCTR_PONM BIT(6)
56#define THCTR_THSST BIT(0)60#define THCTR_THSST BIT(0)
57 61
62/* THSCP bits */
63#define THSCP_COR_PARA_VLD (BIT(15) | BIT(14))
64
58#define CTEMP_MASK 0xFFF65#define CTEMP_MASK 0xFFF
59 66
60#define MCELSIUS(temp) ((temp) * 1000)67#define MCELSIUS(temp) ((temp) * 1000)
@@ -62,15 +69,6 @@ · 1 unmodified line
62 69
63#define TSC_MAX_NUM 570#define TSC_MAX_NUM 5
64 71
65/* default THCODE values if FUSEs are missing */
66static const int thcodes[TSC_MAX_NUM][3] = {
67 { 3397, 2800, 2221 },
68 { 3393, 2795, 2216 },
69 { 3389, 2805, 2237 },
70 { 3415, 2694, 2195 },
71 { 3356, 2724, 2244 },
72};
73
74/* Structure for thermal temperature calculation */72/* Structure for thermal temperature calculation */
75struct equation_coefs {73struct equation_coefs {
76 int a1;74 int a1;
@@ -84,13 +82,14 @@ struct rcar_gen3_thermal_tsc { · 7 unmodified lines
84 struct thermal_zone_device *zone;82 struct thermal_zone_device *zone;
85 struct equation_coefs coef;83 struct equation_coefs coef;
86 int tj_t;84 int tj_t;
87 unsigned int id; /* thermal channel id */85 int thcode[3];
88};86};
89 87
90struct rcar_gen3_thermal_priv {88struct rcar_gen3_thermal_priv {
91 struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM];89 struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM];
92 unsigned int num_tscs;90 unsigned int num_tscs;
93 void (*thermal_init)(struct rcar_gen3_thermal_tsc *tsc);91 void (*thermal_init)(struct rcar_gen3_thermal_tsc *tsc);
92 int ptat[3];
94};93};
95 94
96static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc,95static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc,
@@ -133,8 +132,8 @@ static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc, · 36 unmodified lines
133/* no idea where these constants come from */132/* no idea where these constants come from */
134#define TJ_3 -41133#define TJ_3 -41
135 134
136static void rcar_gen3_thermal_calc_coefs(struct rcar_gen3_thermal_tsc *tsc,135static void rcar_gen3_thermal_calc_coefs(struct rcar_gen3_thermal_priv *priv,
137 int *ptat, const int *thcode,136 struct rcar_gen3_thermal_tsc *tsc,
138 int ths_tj_1)137 int ths_tj_1)
139{138{
140 /* TODO: Find documentation and document constant calculation formula */139 /* TODO: Find documentation and document constant calculation formula */
@@ -143,16 +142,16 @@ static void rcar_gen3_thermal_calc_coefs(struct rcar_gen3_thermal_tsc *tsc, · 2 unmodified lines
143 * Division is not scaled in BSP and if scaled it might overflow142 * Division is not scaled in BSP and if scaled it might overflow
144 * the dividend (4095 * 4095 << 14 > INT_MAX) so keep it unscaled143 * the dividend (4095 * 4095 << 14 > INT_MAX) so keep it unscaled
145 */144 */
146 tsc->tj_t = (FIXPT_INT((ptat[1] - ptat[2]) * (ths_tj_1 - TJ_3))145 tsc->tj_t = (FIXPT_INT((priv->ptat[1] - priv->ptat[2]) * (ths_tj_1 - TJ_3))
147 / (ptat[0] - ptat[2])) + FIXPT_INT(TJ_3);146 / (priv->ptat[0] - priv->ptat[2])) + FIXPT_INT(TJ_3);
148 147
149 tsc->coef.a1 = FIXPT_DIV(FIXPT_INT(thcode[1] - thcode[2]),148 tsc->coef.a1 = FIXPT_DIV(FIXPT_INT(tsc->thcode[1] - tsc->thcode[2]),
150 tsc->tj_t - FIXPT_INT(TJ_3));149 tsc->tj_t - FIXPT_INT(TJ_3));
151 tsc->coef.b1 = FIXPT_INT(thcode[2]) - tsc->coef.a1 * TJ_3;150 tsc->coef.b1 = FIXPT_INT(tsc->thcode[2]) - tsc->coef.a1 * TJ_3;
152 151
153 tsc->coef.a2 = FIXPT_DIV(FIXPT_INT(thcode[1] - thcode[0]),152 tsc->coef.a2 = FIXPT_DIV(FIXPT_INT(tsc->thcode[1] - tsc->thcode[0]),
154 tsc->tj_t - FIXPT_INT(ths_tj_1));153 tsc->tj_t - FIXPT_INT(ths_tj_1));
155 tsc->coef.b2 = FIXPT_INT(thcode[0]) - tsc->coef.a2 * ths_tj_1;154 tsc->coef.b2 = FIXPT_INT(tsc->thcode[0]) - tsc->coef.a2 * ths_tj_1;
156}155}
157 156
158static int rcar_gen3_thermal_round(int temp)157static int rcar_gen3_thermal_round(int temp)
@@ -174,7 +173,7 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) · 15 unmodified lines
174 /* Read register and convert to mili Celsius */173 /* Read register and convert to mili Celsius */
175 reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;174 reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;
176 175
177 if (reg <= thcodes[tsc->id][1])176 if (reg <= tsc->thcode[1])
178 val = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1,177 val = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1,
179 tsc->coef.a1);178 tsc->coef.a1);
180 else179 else
@@ -253,6 +252,64 @@ static const struct soc_device_attribute r8a7795es1[] = { · 72 unmodified lines
253 { /* sentinel */ }252 { /* sentinel */ }
254};253};
255 254
255static bool rcar_gen3_thermal_read_fuses(struct rcar_gen3_thermal_priv *priv)
256{
257 unsigned int i;
258 u32 thscp;
259
260 /* If fuses are not set, fallback to pseudo values. */
261 thscp = rcar_gen3_thermal_read(priv->tscs[0], REG_GEN3_THSCP);
262 if ((thscp & THSCP_COR_PARA_VLD) != THSCP_COR_PARA_VLD) {
263 /* Default THCODE values in case FUSEs are not set. */
264 static const int thcodes[TSC_MAX_NUM][3] = {
265 { 3397, 2800, 2221 },
266 { 3393, 2795, 2216 },
267 { 3389, 2805, 2237 },
268 { 3415, 2694, 2195 },
269 { 3356, 2724, 2244 },
270 };
271
272 priv->ptat[0] = 2631;
273 priv->ptat[1] = 1509;
274 priv->ptat[2] = 435;
275
276 for (i = 0; i < priv->num_tscs; i++) {
277 struct rcar_gen3_thermal_tsc *tsc = priv->tscs[i];
278
279 tsc->thcode[0] = thcodes[i][0];
280 tsc->thcode[1] = thcodes[i][1];
281 tsc->thcode[2] = thcodes[i][2];
282 }
283
284 return false;
285 }
286
287 /*
288 * Set the pseudo calibration points with fused values.
289 * PTAT is shared between all TSCs but only fused for the first
290 * TSC while THCODEs are fused for each TSC.
291 */
292 priv->ptat[0] = rcar_gen3_thermal_read(priv->tscs[0], REG_GEN3_PTAT1) &
293 GEN3_FUSE_MASK;
294 priv->ptat[1] = rcar_gen3_thermal_read(priv->tscs[0], REG_GEN3_PTAT2) &
295 GEN3_FUSE_MASK;
296 priv->ptat[2] = rcar_gen3_thermal_read(priv->tscs[0], REG_GEN3_PTAT3) &
297 GEN3_FUSE_MASK;
298
299 for (i = 0; i < priv->num_tscs; i++) {
300 struct rcar_gen3_thermal_tsc *tsc = priv->tscs[i];
301
302 tsc->thcode[0] = rcar_gen3_thermal_read(tsc, REG_GEN3_THCODE1) &
303 GEN3_FUSE_MASK;
304 tsc->thcode[1] = rcar_gen3_thermal_read(tsc, REG_GEN3_THCODE2) &
305 GEN3_FUSE_MASK;
306 tsc->thcode[2] = rcar_gen3_thermal_read(tsc, REG_GEN3_THCODE3) &
307 GEN3_FUSE_MASK;
308 }
309
310 return true;
311}
312
256static void rcar_gen3_thermal_init_r8a7795es1(struct rcar_gen3_thermal_tsc *tsc)313static void rcar_gen3_thermal_init_r8a7795es1(struct rcar_gen3_thermal_tsc *tsc)
257{314{
258 rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_THBGR);315 rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_THBGR);
@@ -401,10 +458,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) · 142 unmodified lines
401 unsigned int i;458 unsigned int i;
402 int ret;459 int ret;
403 460
404 /* default values if FUSEs are missing */
405 /* TODO: Read values from hardware on supported platforms */
406 int ptat[3] = { 2631, 1509, 435 };
407
408 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);461 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
409 if (!priv)462 if (!priv)
410 return -ENOMEM;463 return -ENOMEM;
@@ -439,9 +492,17 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) · 28 unmodified lines
439 ret = PTR_ERR(tsc->base);492 ret = PTR_ERR(tsc->base);
440 goto error_unregister;493 goto error_unregister;
441 }494 }
442 tsc->id = i;
443 495
444 priv->tscs[i] = tsc;496 priv->tscs[i] = tsc;
497 }
498
499 priv->num_tscs = i;
500
501 if (!rcar_gen3_thermal_read_fuses(priv))
502 dev_info(dev, "No calibration values fused, fallback to driver values\n");
503
504 for (i = 0; i < priv->num_tscs; i++) {
505 struct rcar_gen3_thermal_tsc *tsc = priv->tscs[i];
445 506
446 zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,507 zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,
447 &rcar_gen3_tz_of_ops);508 &rcar_gen3_tz_of_ops);
@@ -453,7 +514,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) · 5 unmodified lines
453 tsc->zone = zone;514 tsc->zone = zone;
454 515
455 priv->thermal_init(tsc);516 priv->thermal_init(tsc);
456 rcar_gen3_thermal_calc_coefs(tsc, ptat, thcodes[i], *ths_tj_1);517 rcar_gen3_thermal_calc_coefs(priv, tsc, *ths_tj_1);
457 518
458 tsc->zone->tzp->no_hwmon = false;519 tsc->zone->tzp->no_hwmon = false;
459 ret = thermal_add_hwmon_sysfs(tsc->zone);520 ret = thermal_add_hwmon_sysfs(tsc->zone);
@@ -471,8 +532,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) · 11 unmodified lines
471 dev_info(dev, "TSC%u: Loaded %d trip points\n", i, ret);532 dev_info(dev, "TSC%u: Loaded %d trip points\n", i, ret);
472 }533 }
473 534
474 priv->num_tscs = i;
475
476 if (!priv->num_tscs) {535 if (!priv->num_tscs) {
477 ret = -ENODEV;536 ret = -ENODEV;
478 goto error_unregister;537 goto error_unregister;
drivers/thermal/rockchip_thermal.c+1−1
@@ -1383,7 +1383,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev) · 1382 unmodified lines
1383 if (IS_ERR(thermal->regs))1383 if (IS_ERR(thermal->regs))
1384 return PTR_ERR(thermal->regs);1384 return PTR_ERR(thermal->regs);
1385 1385
1386 thermal->reset = devm_reset_control_get(&pdev->dev, "tsadc-apb");1386 thermal->reset = devm_reset_control_array_get(&pdev->dev, false, false);
1387 if (IS_ERR(thermal->reset)) {1387 if (IS_ERR(thermal->reset)) {
1388 error = PTR_ERR(thermal->reset);1388 error = PTR_ERR(thermal->reset);
1389 dev_err(&pdev->dev, "failed to get tsadc reset: %d\n", error);1389 dev_err(&pdev->dev, "failed to get tsadc reset: %d\n", error);
drivers/thermal/thermal_core.c+16−6
@@ -375,10 +375,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) · 374 unmodified lines
375 if (tz->last_temperature != THERMAL_TEMP_INVALID) {375 if (tz->last_temperature != THERMAL_TEMP_INVALID) {
376 if (tz->last_temperature < trip_temp &&376 if (tz->last_temperature < trip_temp &&
377 tz->temperature >= trip_temp)377 tz->temperature >= trip_temp)
378 thermal_notify_tz_trip_up(tz->id, trip);378 thermal_notify_tz_trip_up(tz->id, trip,
379 tz->temperature);
379 if (tz->last_temperature >= trip_temp &&380 if (tz->last_temperature >= trip_temp &&
380 tz->temperature < (trip_temp - hyst))381 tz->temperature < (trip_temp - hyst))
381 thermal_notify_tz_trip_down(tz->id, trip);382 thermal_notify_tz_trip_down(tz->id, trip,
383 tz->temperature);
382 }384 }
383 385
384 if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT)386 if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT)
@@ -887,7 +889,7 @@ __thermal_cooling_device_register(struct device_node *np, · 502 unmodified lines
887{889{
888 struct thermal_cooling_device *cdev;890 struct thermal_cooling_device *cdev;
889 struct thermal_zone_device *pos = NULL;891 struct thermal_zone_device *pos = NULL;
890 int ret;892 int id, ret;
891 893
892 if (!ops || !ops->get_max_state || !ops->get_cur_state ||894 if (!ops || !ops->get_max_state || !ops->get_cur_state ||
893 !ops->set_cur_state)895 !ops->set_cur_state)
@@ -901,6 +903,11 @@ __thermal_cooling_device_register(struct device_node *np, · 7 unmodified lines
901 if (ret < 0)903 if (ret < 0)
902 goto out_kfree_cdev;904 goto out_kfree_cdev;
903 cdev->id = ret;905 cdev->id = ret;
906 id = ret;
907
908 ret = dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
909 if (ret)
910 goto out_ida_remove;
904 911
905 cdev->type = kstrdup(type ? type : "", GFP_KERNEL);912 cdev->type = kstrdup(type ? type : "", GFP_KERNEL);
906 if (!cdev->type) {913 if (!cdev->type) {
@@ -916,7 +923,6 @@ __thermal_cooling_device_register(struct device_node *np, · 9 unmodified lines
916 cdev->device.class = &thermal_class;923 cdev->device.class = &thermal_class;
917 cdev->devdata = devdata;924 cdev->devdata = devdata;
918 thermal_cooling_device_setup_sysfs(cdev);925 thermal_cooling_device_setup_sysfs(cdev);
919 dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
920 ret = device_register(&cdev->device);926 ret = device_register(&cdev->device);
921 if (ret)927 if (ret)
922 goto out_kfree_type;928 goto out_kfree_type;
@@ -941,8 +947,9 @@ __thermal_cooling_device_register(struct device_node *np, · 18 unmodified lines
941out_kfree_type:947out_kfree_type:
942 kfree(cdev->type);948 kfree(cdev->type);
943 put_device(&cdev->device);949 put_device(&cdev->device);
950 cdev = NULL;
944out_ida_remove:951out_ida_remove:
945 ida_simple_remove(&thermal_cdev_ida, cdev->id);952 ida_simple_remove(&thermal_cdev_ida, id);
946out_kfree_cdev:953out_kfree_cdev:
947 kfree(cdev);954 kfree(cdev);
948 return ERR_PTR(ret);955 return ERR_PTR(ret);
@@ -1227,6 +1234,10 @@ thermal_zone_device_register(const char *type, int trips, int mask, · 278 unmodified lines
1227 tz->id = id;1234 tz->id = id;
1228 strlcpy(tz->type, type, sizeof(tz->type));1235 strlcpy(tz->type, type, sizeof(tz->type));
1229 1236
1237 result = dev_set_name(&tz->device, "thermal_zone%d", tz->id);
1238 if (result)
1239 goto remove_id;
1240
1230 if (!ops->critical)1241 if (!ops->critical)
1231 ops->critical = thermal_zone_device_critical;1242 ops->critical = thermal_zone_device_critical;
1232 1243
@@ -1248,7 +1259,6 @@ thermal_zone_device_register(const char *type, int trips, int mask, · 15 unmodified lines
1248 /* A new thermal zone needs to be updated anyway. */1259 /* A new thermal zone needs to be updated anyway. */
1249 atomic_set(&tz->need_update, 1);1260 atomic_set(&tz->need_update, 1);
1250 1261
1251 dev_set_name(&tz->device, "thermal_zone%d", tz->id);
1252 result = device_register(&tz->device);1262 result = device_register(&tz->device);
1253 if (result)1263 if (result)
1254 goto release_device;1264 goto release_device;
drivers/thermal/thermal_mmio.c+1−1
@@ -34,7 +34,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp) · 33 unmodified lines
34 return 0;34 return 0;
35}35}
36 36
37static struct thermal_zone_of_device_ops thermal_mmio_ops = {37static const struct thermal_zone_of_device_ops thermal_mmio_ops = {
38 .get_temp = thermal_mmio_get_temperature,38 .get_temp = thermal_mmio_get_temperature,
39};39};
40 40
drivers/thermal/thermal_netlink.c+6−5
@@ -121,7 +121,8 @@ static int thermal_genl_event_tz(struct param *p) · 120 unmodified lines
121static int thermal_genl_event_tz_trip_up(struct param *p)121static int thermal_genl_event_tz_trip_up(struct param *p)
122{122{
123 if (nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_ID, p->tz_id) ||123 if (nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_ID, p->tz_id) ||
124 nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id))124 nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id) ||
125 nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TEMP, p->temp))
125 return -EMSGSIZE;126 return -EMSGSIZE;
126 127
127 return 0;128 return 0;
@@ -285,16 +286,16 @@ int thermal_notify_tz_disable(int tz_id) · 157 unmodified lines
285 return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_DISABLE, &p);286 return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_DISABLE, &p);
286}287}
287 288
288int thermal_notify_tz_trip_down(int tz_id, int trip_id)289int thermal_notify_tz_trip_down(int tz_id, int trip_id, int temp)
289{290{
290 struct param p = { .tz_id = tz_id, .trip_id = trip_id };291 struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
291 292
292 return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_DOWN, &p);293 return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_DOWN, &p);
293}294}
294 295
295int thermal_notify_tz_trip_up(int tz_id, int trip_id)296int thermal_notify_tz_trip_up(int tz_id, int trip_id, int temp)
296{297{
297 struct param p = { .tz_id = tz_id, .trip_id = trip_id };298 struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
298 299
299 return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_UP, &p);300 return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_UP, &p);
300}301}
drivers/thermal/thermal_netlink.h+4−4
@@ -11,8 +11,8 @@ int thermal_notify_tz_create(int tz_id, const char *name); · 10 unmodified lines
11int thermal_notify_tz_delete(int tz_id);11int thermal_notify_tz_delete(int tz_id);
12int thermal_notify_tz_enable(int tz_id);12int thermal_notify_tz_enable(int tz_id);
13int thermal_notify_tz_disable(int tz_id);13int thermal_notify_tz_disable(int tz_id);
14int thermal_notify_tz_trip_down(int tz_id, int id);14int thermal_notify_tz_trip_down(int tz_id, int id, int temp);
15int thermal_notify_tz_trip_up(int tz_id, int id);15int thermal_notify_tz_trip_up(int tz_id, int id, int temp);
16int thermal_notify_tz_trip_delete(int tz_id, int id);16int thermal_notify_tz_trip_delete(int tz_id, int id);
17int thermal_notify_tz_trip_add(int tz_id, int id, int type,17int thermal_notify_tz_trip_add(int tz_id, int id, int type,
18 int temp, int hyst);18 int temp, int hyst);
@@ -49,12 +49,12 @@ static inline int thermal_notify_tz_disable(int tz_id) · 30 unmodified lines
49 return 0;49 return 0;
50}50}
51 51
52static inline int thermal_notify_tz_trip_down(int tz_id, int id)52static inline int thermal_notify_tz_trip_down(int tz_id, int id, int temp)
53{53{
54 return 0;54 return 0;
55}55}
56 56
57static inline int thermal_notify_tz_trip_up(int tz_id, int id)57static inline int thermal_notify_tz_trip_up(int tz_id, int id, int temp)
58{58{
59 return 0;59 return 0;
60}60}
drivers/thermal/thermal_sysfs.c+3−0
@@ -610,6 +610,9 @@ cur_state_store(struct device *dev, struct device_attribute *attr, · 609 unmodified lines
610 unsigned long state;610 unsigned long state;
611 int result;611 int result;
612 612
613 dev_warn_once(&cdev->device,
614 "Setting cooling device state is deprecated\n");
615
613 if (sscanf(buf, "%ld\n", &state) != 1)616 if (sscanf(buf, "%ld\n", &state) != 1)
614 return -EINVAL;617 return -EINVAL;
615 618
drivers/thermal/uniphier_thermal.c+4−0
@@ -358,6 +358,10 @@ static const struct of_device_id uniphier_tm_dt_ids[] = { · 357 unmodified lines
358 .compatible = "socionext,uniphier-pxs3-thermal",358 .compatible = "socionext,uniphier-pxs3-thermal",
359 .data = &uniphier_ld20_tm_data,359 .data = &uniphier_ld20_tm_data,
360 },360 },
361 {
362 .compatible = "socionext,uniphier-nx1-thermal",
363 .data = &uniphier_ld20_tm_data,
364 },
361 { /* sentinel */ }365 { /* sentinel */ }
362};366};
363MODULE_DEVICE_TABLE(of, uniphier_tm_dt_ids);367MODULE_DEVICE_TABLE(of, uniphier_tm_dt_ids);