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

arm64: dts: mediatek: cherry: Add platform thermal configuration

This platform has three auxiliary NTC thermistors, connected to the
SoC's ADC pins. Enable the auxadc in order to be able to read the
ADC values, add a generic-adc-thermal LUT for each and finally assign
them to the SoC's thermal zones.

Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230424112523.1436926-2-angelogioacchino.delregno@collabora.com

+105
+105
arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
··· 127 127 regulator-boot-on; 128 128 }; 129 129 130 + /* Murata NCP03WF104F05RL */ 131 + tboard_thermistor1: thermal-sensor-t1 { 132 + compatible = "generic-adc-thermal"; 133 + #thermal-sensor-cells = <0>; 134 + io-channels = <&auxadc 0>; 135 + io-channel-names = "sensor-channel"; 136 + temperature-lookup-table = < (-10000) 1553 137 + (-5000) 1485 138 + 0 1406 139 + 5000 1317 140 + 10000 1219 141 + 15000 1115 142 + 20000 1007 143 + 25000 900 144 + 30000 796 145 + 35000 697 146 + 40000 605 147 + 45000 523 148 + 50000 449 149 + 55000 384 150 + 60000 327 151 + 65000 279 152 + 70000 237 153 + 75000 202 154 + 80000 172 155 + 85000 147 156 + 90000 125 157 + 95000 107 158 + 100000 92 159 + 105000 79 160 + 110000 68 161 + 115000 59 162 + 120000 51 163 + 125000 44>; 164 + }; 165 + 166 + tboard_thermistor2: thermal-sensor-t2 { 167 + compatible = "generic-adc-thermal"; 168 + #thermal-sensor-cells = <0>; 169 + io-channels = <&auxadc 1>; 170 + io-channel-names = "sensor-channel"; 171 + temperature-lookup-table = < (-10000) 1553 172 + (-5000) 1485 173 + 0 1406 174 + 5000 1317 175 + 10000 1219 176 + 15000 1115 177 + 20000 1007 178 + 25000 900 179 + 30000 796 180 + 35000 697 181 + 40000 605 182 + 45000 523 183 + 50000 449 184 + 55000 384 185 + 60000 327 186 + 65000 279 187 + 70000 237 188 + 75000 202 189 + 80000 172 190 + 85000 147 191 + 90000 125 192 + 95000 107 193 + 100000 92 194 + 105000 79 195 + 110000 68 196 + 115000 59 197 + 120000 51 198 + 125000 44>; 199 + }; 200 + 130 201 usb_vbus: regulator-5v0-usb-vbus { 131 202 compatible = "regulator-fixed"; 132 203 regulator-name = "usb-vbus"; ··· 258 187 mediatek,etdm-in2-cowork-source = <2>; 259 188 mediatek,etdm-out2-cowork-source = <0>; 260 189 memory-region = <&afe_mem>; 190 + }; 191 + 192 + &auxadc { 193 + status = "okay"; 261 194 }; 262 195 263 196 &dp_intf0 { ··· 1230 1155 regulator-ramp-delay = <6250>; 1231 1156 regulator-allowed-modes = <0 1 2>; 1232 1157 regulator-always-on; 1158 + }; 1159 + }; 1160 + }; 1161 + }; 1162 + 1163 + &thermal_zones { 1164 + soc-area-thermal { 1165 + polling-delay = <1000>; 1166 + polling-delay-passive = <250>; 1167 + thermal-sensors = <&tboard_thermistor1>; 1168 + 1169 + trips { 1170 + trip-crit { 1171 + temperature = <84000>; 1172 + hysteresis = <1000>; 1173 + type = "critical"; 1174 + }; 1175 + }; 1176 + }; 1177 + 1178 + pmic-area-thermal { 1179 + polling-delay = <1000>; 1180 + polling-delay-passive = <0>; 1181 + thermal-sensors = <&tboard_thermistor2>; 1182 + 1183 + trips { 1184 + trip-crit { 1185 + temperature = <84000>; 1186 + hysteresis = <1000>; 1187 + type = "critical"; 1233 1188 }; 1234 1189 }; 1235 1190 };