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

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

Pull more thermal control updates from Rafael Wysocki:
"These update a few thermal drivers used on ARM platforms and thermal
tools:

- Add SAR2130P compatible to DT bindings in the QCom Tsens driver
(Dmitry Baryshkov)

- Add static annotation to arrays describing platform sensors in the
LVTS Mediatek driver (Colin Ian King)

- Switch back to struct platform_driver::remove() from the previous
callbacks prototype rework (Uwe Kleine-König)

- Add MSM8937 compatible to DT bindings and its support in the QCom
Tsens driver (Barnabás Czémán)

- Remove a pointless sign test on an unsigned value in
k3_bgp_read_temp() in the k3_j72xx_bandgap driver (Rex Nie)

- Fix a pointer reference loss when realloc() fails in the thermal
library (Zhang Jiao)"

* tag 'thermal-6.13-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
tools/thermal: Fix common realloc mistake
thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp()
thermal/drivers/qcom/tsens-v1: Add support for MSM8937 tsens
dt-bindings: thermal: tsens: Add MSM8937
thermal: Switch back to struct platform_driver::remove()
thermal/drivers/mediatek/lvts_thermal: Make read-only arrays static const
dt-bindings: thermal: qcom-tsens: Add SAR2130P compatible

+62 -49
+2
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
··· 39 39 - description: v1 of TSENS 40 40 items: 41 41 - enum: 42 + - qcom,msm8937-tsens 42 43 - qcom,msm8956-tsens 43 44 - qcom,msm8976-tsens 44 45 - qcom,qcs404-tsens ··· 54 53 - qcom,qcm2290-tsens 55 54 - qcom,sa8255p-tsens 56 55 - qcom,sa8775p-tsens 56 + - qcom,sar2130p-tsens 57 57 - qcom,sc7180-tsens 58 58 - qcom,sc7280-tsens 59 59 - qcom,sc8180x-tsens
+1 -1
drivers/thermal/amlogic_thermal.c
··· 333 333 .of_match_table = of_amlogic_thermal_match, 334 334 }, 335 335 .probe = amlogic_thermal_probe, 336 - .remove_new = amlogic_thermal_remove, 336 + .remove = amlogic_thermal_remove, 337 337 }; 338 338 339 339 module_platform_driver(amlogic_thermal_driver);
+1 -1
drivers/thermal/armada_thermal.c
··· 970 970 971 971 static struct platform_driver armada_thermal_driver = { 972 972 .probe = armada_thermal_probe, 973 - .remove_new = armada_thermal_exit, 973 + .remove = armada_thermal_exit, 974 974 .driver = { 975 975 .name = "armada_thermal", 976 976 .of_match_table = armada_thermal_id_table,
+1 -1
drivers/thermal/broadcom/bcm2835_thermal.c
··· 268 268 269 269 static struct platform_driver bcm2835_thermal_driver = { 270 270 .probe = bcm2835_thermal_probe, 271 - .remove_new = bcm2835_thermal_remove, 271 + .remove = bcm2835_thermal_remove, 272 272 .driver = { 273 273 .name = "bcm2835_thermal", 274 274 .of_match_table = bcm2835_thermal_of_match_table,
+1 -1
drivers/thermal/broadcom/ns-thermal.c
··· 80 80 81 81 static struct platform_driver ns_thermal_driver = { 82 82 .probe = ns_thermal_probe, 83 - .remove_new = ns_thermal_remove, 83 + .remove = ns_thermal_remove, 84 84 .driver = { 85 85 .name = "ns-thermal", 86 86 .of_match_table = ns_thermal_of_match,
+3 -3
drivers/thermal/da9062-thermal.c
··· 250 250 251 251 static struct platform_driver da9062_thermal_driver = { 252 252 .probe = da9062_thermal_probe, 253 - .remove_new = da9062_thermal_remove, 253 + .remove = da9062_thermal_remove, 254 254 .driver = { 255 - .name = "da9062-thermal", 256 - .of_match_table = da9062_compatible_reg_id_table, 255 + .name = "da9062-thermal", 256 + .of_match_table = da9062_compatible_reg_id_table, 257 257 }, 258 258 }; 259 259
+1 -1
drivers/thermal/dove_thermal.c
··· 170 170 171 171 static struct platform_driver dove_thermal_driver = { 172 172 .probe = dove_thermal_probe, 173 - .remove_new = dove_thermal_exit, 173 + .remove = dove_thermal_exit, 174 174 .driver = { 175 175 .name = "dove_thermal", 176 176 .of_match_table = dove_thermal_id_table,
+2 -2
drivers/thermal/hisi_thermal.c
··· 637 637 .driver = { 638 638 .name = "hisi_thermal", 639 639 .pm = pm_sleep_ptr(&hisi_thermal_pm_ops), 640 - .of_match_table = of_hisi_thermal_match, 640 + .of_match_table = of_hisi_thermal_match, 641 641 }, 642 642 .probe = hisi_thermal_probe, 643 - .remove_new = hisi_thermal_remove, 643 + .remove = hisi_thermal_remove, 644 644 }; 645 645 646 646 module_platform_driver(hisi_thermal_driver);
+1 -1
drivers/thermal/imx8mm_thermal.c
··· 399 399 .of_match_table = imx8mm_tmu_table, 400 400 }, 401 401 .probe = imx8mm_tmu_probe, 402 - .remove_new = imx8mm_tmu_remove, 402 + .remove = imx8mm_tmu_remove, 403 403 }; 404 404 module_platform_driver(imx8mm_tmu); 405 405
+1 -1
drivers/thermal/imx_thermal.c
··· 861 861 .of_match_table = of_imx_thermal_match, 862 862 }, 863 863 .probe = imx_thermal_probe, 864 - .remove_new = imx_thermal_remove, 864 + .remove = imx_thermal_remove, 865 865 }; 866 866 module_platform_driver(imx_thermal); 867 867
+1 -1
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
··· 707 707 708 708 static struct platform_driver int3400_thermal_driver = { 709 709 .probe = int3400_thermal_probe, 710 - .remove_new = int3400_thermal_remove, 710 + .remove = int3400_thermal_remove, 711 711 .driver = { 712 712 .name = "int3400 thermal", 713 713 .acpi_match_table = ACPI_PTR(int3400_thermal_match),
+1 -1
drivers/thermal/intel/int340x_thermal/int3401_thermal.c
··· 60 60 61 61 static struct platform_driver int3401_driver = { 62 62 .probe = int3401_add, 63 - .remove_new = int3401_remove, 63 + .remove = int3401_remove, 64 64 .driver = { 65 65 .name = "int3401 thermal", 66 66 .acpi_match_table = int3401_device_ids,
+1 -1
drivers/thermal/intel/int340x_thermal/int3402_thermal.c
··· 89 89 90 90 static struct platform_driver int3402_thermal_driver = { 91 91 .probe = int3402_thermal_probe, 92 - .remove_new = int3402_thermal_remove, 92 + .remove = int3402_thermal_remove, 93 93 .driver = { 94 94 .name = "int3402 thermal", 95 95 .acpi_match_table = int3402_thermal_match,
+1 -1
drivers/thermal/intel/int340x_thermal/int3403_thermal.c
··· 281 281 282 282 static struct platform_driver int3403_driver = { 283 283 .probe = int3403_add, 284 - .remove_new = int3403_remove, 284 + .remove = int3403_remove, 285 285 .driver = { 286 286 .name = "int3403 thermal", 287 287 .acpi_match_table = int3403_device_ids,
+1 -1
drivers/thermal/intel/int340x_thermal/int3406_thermal.c
··· 195 195 196 196 static struct platform_driver int3406_thermal_driver = { 197 197 .probe = int3406_thermal_probe, 198 - .remove_new = int3406_thermal_remove, 198 + .remove = int3406_thermal_remove, 199 199 .driver = { 200 200 .name = "int3406 thermal", 201 201 .acpi_match_table = int3406_thermal_match,
+1 -1
drivers/thermal/k3_bandgap.c
··· 250 250 251 251 static struct platform_driver k3_bandgap_sensor_driver = { 252 252 .probe = k3_bandgap_probe, 253 - .remove_new = k3_bandgap_remove, 253 + .remove = k3_bandgap_remove, 254 254 .driver = { 255 255 .name = "k3-soc-thermal", 256 256 .of_match_table = of_k3_bandgap_match,
+2 -2
drivers/thermal/k3_j72xx_bandgap.c
··· 238 238 K3_VTM_TS_STAT_DTEMP_MASK; 239 239 dtemp = vtm_get_best_value(s0, s1, s2); 240 240 241 - if (dtemp < 0 || dtemp >= TABLE_SIZE) 241 + if (dtemp >= TABLE_SIZE) 242 242 return -EINVAL; 243 243 244 244 *temp = derived_table[dtemp]; ··· 594 594 595 595 static struct platform_driver k3_j72xx_bandgap_sensor_driver = { 596 596 .probe = k3_j72xx_bandgap_probe, 597 - .remove_new = k3_j72xx_bandgap_remove, 597 + .remove = k3_j72xx_bandgap_remove, 598 598 .driver = { 599 599 .name = "k3-j72xx-soc-thermal", 600 600 .of_match_table = of_k3_j72xx_bandgap_match,
+1 -1
drivers/thermal/kirkwood_thermal.c
··· 102 102 103 103 static struct platform_driver kirkwood_thermal_driver = { 104 104 .probe = kirkwood_thermal_probe, 105 - .remove_new = kirkwood_thermal_exit, 105 + .remove = kirkwood_thermal_exit, 106 106 .driver = { 107 107 .name = "kirkwood_thermal", 108 108 .of_match_table = kirkwood_thermal_id_table,
+3 -3
drivers/thermal/mediatek/lvts_thermal.c
··· 329 329 330 330 static void lvts_update_irq_mask(struct lvts_ctrl *lvts_ctrl) 331 331 { 332 - u32 masks[] = { 332 + static const u32 masks[] = { 333 333 LVTS_MONINT_OFFSET_SENSOR0, 334 334 LVTS_MONINT_OFFSET_SENSOR1, 335 335 LVTS_MONINT_OFFSET_SENSOR2, ··· 424 424 { 425 425 irqreturn_t iret = IRQ_NONE; 426 426 u32 value; 427 - u32 masks[] = { 427 + static const u32 masks[] = { 428 428 LVTS_INT_SENSOR0, 429 429 LVTS_INT_SENSOR1, 430 430 LVTS_INT_SENSOR2, ··· 1788 1788 1789 1789 static struct platform_driver lvts_driver = { 1790 1790 .probe = lvts_probe, 1791 - .remove_new = lvts_remove, 1791 + .remove = lvts_remove, 1792 1792 .driver = { 1793 1793 .name = "mtk-lvts-thermal", 1794 1794 .of_match_table = lvts_of_match,
+14 -7
drivers/thermal/qcom/tsens-v1.c
··· 162 162 .fields = tsens_v1_regfields, 163 163 }; 164 164 165 + static const struct tsens_ops ops_common = { 166 + .init = init_common, 167 + .calibrate = tsens_calibrate_common, 168 + .get_temp = get_temp_tsens_valid, 169 + }; 170 + 171 + struct tsens_plat_data data_8937 = { 172 + .num_sensors = 11, 173 + .ops = &ops_common, 174 + .feat = &tsens_v1_feat, 175 + .fields = tsens_v1_regfields, 176 + }; 177 + 165 178 static const struct tsens_ops ops_8956 = { 166 179 .init = init_8956, 167 180 .calibrate = tsens_calibrate_common, ··· 188 175 .fields = tsens_v1_regfields, 189 176 }; 190 177 191 - static const struct tsens_ops ops_8976 = { 192 - .init = init_common, 193 - .calibrate = tsens_calibrate_common, 194 - .get_temp = get_temp_tsens_valid, 195 - }; 196 - 197 178 struct tsens_plat_data data_8976 = { 198 179 .num_sensors = 11, 199 - .ops = &ops_8976, 180 + .ops = &ops_common, 200 181 .feat = &tsens_v1_feat, 201 182 .fields = tsens_v1_regfields, 202 183 };
+4 -1
drivers/thermal/qcom/tsens.c
··· 1120 1120 .compatible = "qcom,msm8916-tsens", 1121 1121 .data = &data_8916, 1122 1122 }, { 1123 + .compatible = "qcom,msm8937-tsens", 1124 + .data = &data_8937, 1125 + }, { 1123 1126 .compatible = "qcom,msm8939-tsens", 1124 1127 .data = &data_8939, 1125 1128 }, { ··· 1363 1360 1364 1361 static struct platform_driver tsens_driver = { 1365 1362 .probe = tsens_probe, 1366 - .remove_new = tsens_remove, 1363 + .remove = tsens_remove, 1367 1364 .driver = { 1368 1365 .name = "qcom-tsens", 1369 1366 .pm = &tsens_pm_ops,
+1 -1
drivers/thermal/qcom/tsens.h
··· 647 647 extern struct tsens_plat_data data_8226, data_8909, data_8916, data_8939, data_8974, data_9607; 648 648 649 649 /* TSENS v1 targets */ 650 - extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; 650 + extern struct tsens_plat_data data_tsens_v1, data_8937, data_8976, data_8956; 651 651 652 652 /* TSENS v2 targets */ 653 653 extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;
+1 -1
drivers/thermal/renesas/rcar_gen3_thermal.c
··· 603 603 .of_match_table = rcar_gen3_thermal_dt_ids, 604 604 }, 605 605 .probe = rcar_gen3_thermal_probe, 606 - .remove_new = rcar_gen3_thermal_remove, 606 + .remove = rcar_gen3_thermal_remove, 607 607 }; 608 608 module_platform_driver(rcar_gen3_thermal_driver); 609 609
+1 -1
drivers/thermal/renesas/rcar_thermal.c
··· 579 579 .of_match_table = rcar_thermal_dt_ids, 580 580 }, 581 581 .probe = rcar_thermal_probe, 582 - .remove_new = rcar_thermal_remove, 582 + .remove = rcar_thermal_remove, 583 583 }; 584 584 module_platform_driver(rcar_thermal_driver); 585 585
+1 -1
drivers/thermal/renesas/rzg2l_thermal.c
··· 240 240 .of_match_table = rzg2l_thermal_dt_ids, 241 241 }, 242 242 .probe = rzg2l_thermal_probe, 243 - .remove_new = rzg2l_thermal_remove, 243 + .remove = rzg2l_thermal_remove, 244 244 }; 245 245 module_platform_driver(rzg2l_thermal_driver); 246 246
+1 -1
drivers/thermal/rockchip_thermal.c
··· 1689 1689 .of_match_table = of_rockchip_thermal_match, 1690 1690 }, 1691 1691 .probe = rockchip_thermal_probe, 1692 - .remove_new = rockchip_thermal_remove, 1692 + .remove = rockchip_thermal_remove, 1693 1693 }; 1694 1694 1695 1695 module_platform_driver(rockchip_thermal_driver);
+1 -1
drivers/thermal/samsung/exynos_tmu.c
··· 1164 1164 .of_match_table = exynos_tmu_match, 1165 1165 }, 1166 1166 .probe = exynos_tmu_probe, 1167 - .remove_new = exynos_tmu_remove, 1167 + .remove = exynos_tmu_remove, 1168 1168 }; 1169 1169 1170 1170 module_platform_driver(exynos_tmu_driver);
+1 -1
drivers/thermal/spear_thermal.c
··· 173 173 174 174 static struct platform_driver spear_thermal_driver = { 175 175 .probe = spear_thermal_probe, 176 - .remove_new = spear_thermal_exit, 176 + .remove = spear_thermal_exit, 177 177 .driver = { 178 178 .name = "spear_thermal", 179 179 .pm = &spear_thermal_pm_ops,
+1 -1
drivers/thermal/sprd_thermal.c
··· 534 534 535 535 static struct platform_driver sprd_thermal_driver = { 536 536 .probe = sprd_thm_probe, 537 - .remove_new = sprd_thm_remove, 537 + .remove = sprd_thm_remove, 538 538 .driver = { 539 539 .name = "sprd-thermal", 540 540 .pm = &sprd_thermal_pm_ops,
+1 -1
drivers/thermal/st/st_thermal_memmap.c
··· 174 174 .of_match_table = st_mmap_thermal_of_match, 175 175 }, 176 176 .probe = st_mmap_probe, 177 - .remove_new = st_mmap_remove, 177 + .remove = st_mmap_remove, 178 178 }; 179 179 180 180 module_platform_driver(st_mmap_thermal_driver);
+1 -1
drivers/thermal/st/stm_thermal.c
··· 582 582 .of_match_table = stm_thermal_of_match, 583 583 }, 584 584 .probe = stm_thermal_probe, 585 - .remove_new = stm_thermal_remove, 585 + .remove = stm_thermal_remove, 586 586 }; 587 587 module_platform_driver(stm_thermal_driver); 588 588
+1 -1
drivers/thermal/tegra/soctherm.c
··· 2269 2269 2270 2270 static struct platform_driver tegra_soctherm_driver = { 2271 2271 .probe = tegra_soctherm_probe, 2272 - .remove_new = tegra_soctherm_remove, 2272 + .remove = tegra_soctherm_remove, 2273 2273 .driver = { 2274 2274 .name = "tegra_soctherm", 2275 2275 .pm = &tegra_soctherm_pm,
+1 -1
drivers/thermal/tegra/tegra-bpmp-thermal.c
··· 315 315 316 316 static struct platform_driver tegra_bpmp_thermal_driver = { 317 317 .probe = tegra_bpmp_thermal_probe, 318 - .remove_new = tegra_bpmp_thermal_remove, 318 + .remove = tegra_bpmp_thermal_remove, 319 319 .driver = { 320 320 .name = "tegra-bpmp-thermal", 321 321 .of_match_table = tegra_bpmp_thermal_of_match,
+1 -1
drivers/thermal/ti-soc-thermal/ti-bandgap.c
··· 1281 1281 1282 1282 static struct platform_driver ti_bandgap_sensor_driver = { 1283 1283 .probe = ti_bandgap_probe, 1284 - .remove_new = ti_bandgap_remove, 1284 + .remove = ti_bandgap_remove, 1285 1285 .driver = { 1286 1286 .name = "ti-soc-thermal", 1287 1287 .pm = DEV_PM_OPS,
+1 -1
drivers/thermal/uniphier_thermal.c
··· 371 371 372 372 static struct platform_driver uniphier_tm_driver = { 373 373 .probe = uniphier_tm_probe, 374 - .remove_new = uniphier_tm_remove, 374 + .remove = uniphier_tm_remove, 375 375 .driver = { 376 376 .name = "uniphier-thermal", 377 377 .of_match_table = uniphier_tm_dt_ids,
+4 -3
tools/thermal/thermometer/thermometer.c
··· 259 259 { 260 260 int fd; 261 261 char tz_path[PATH_MAX]; 262 + struct tz *tz; 262 263 263 264 sprintf(tz_path, CLASS_THERMAL"/%s/temp", path); 264 265 ··· 269 268 return -1; 270 269 } 271 270 272 - thermometer->tz = realloc(thermometer->tz, 273 - sizeof(*thermometer->tz) * (thermometer->nr_tz + 1)); 274 - if (!thermometer->tz) { 271 + tz = realloc(thermometer->tz, sizeof(*thermometer->tz) * (thermometer->nr_tz + 1)); 272 + if (!tz) { 275 273 ERROR("Failed to allocate thermometer->tz\n"); 276 274 return -1; 277 275 } 278 276 277 + thermometer->tz = tz; 279 278 thermometer->tz[thermometer->nr_tz].fd_temp = fd; 280 279 thermometer->tz[thermometer->nr_tz].name = strdup(name); 281 280 thermometer->tz[thermometer->nr_tz].polling = polling;