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

Merge back general thermal control changes for 6.4-rc1.

+140 -111
+1
Documentation/devicetree/bindings/thermal/mediatek-thermal.txt
··· 16 16 - "mediatek,mt7981-thermal", "mediatek,mt7986-thermal" : For MT7981 SoC 17 17 - "mediatek,mt7986-thermal" : For MT7986 SoC 18 18 - "mediatek,mt8183-thermal" : For MT8183 family of SoCs 19 + - "mediatek,mt8365-thermal" : For MT8365 family of SoCs 19 20 - "mediatek,mt8516-thermal", "mediatek,mt2701-thermal : For MT8516 family of SoCs 20 21 - reg: Address range of the thermal controller 21 22 - interrupts: IRQ for the thermal controller
+2 -1
drivers/thermal/Makefile
··· 2 2 # 3 3 # Makefile for sensor chip drivers. 4 4 # 5 - 5 + CFLAGS_thermal_core.o := -I$(src) 6 6 obj-$(CONFIG_THERMAL) += thermal_sys.o 7 7 thermal_sys-y += thermal_core.o thermal_sysfs.o 8 8 thermal_sys-y += thermal_trip.o thermal_helpers.o ··· 16 16 thermal_sys-$(CONFIG_THERMAL_ACPI) += thermal_acpi.o 17 17 18 18 # governors 19 + CFLAGS_gov_power_allocator.o := -I$(src) 19 20 thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE) += gov_fair_share.o 20 21 thermal_sys-$(CONFIG_THERMAL_GOV_BANG_BANG) += gov_bang_bang.o 21 22 thermal_sys-$(CONFIG_THERMAL_GOV_STEP_WISE) += gov_step_wise.o
+2 -2
drivers/thermal/cpufreq_cooling.c
··· 23 23 #include <linux/thermal.h> 24 24 #include <linux/units.h> 25 25 26 - #include <trace/events/thermal.h> 26 + #include "thermal_trace.h" 27 27 28 28 /* 29 29 * Cooling state <-> CPUFreq frequency ··· 633 633 return NULL; 634 634 } 635 635 636 - if (of_find_property(np, "#cooling-cells", NULL)) { 636 + if (of_property_present(np, "#cooling-cells")) { 637 637 struct em_perf_domain *em = em_cpu_get(policy->cpu); 638 638 639 639 cdev = __cpufreq_cooling_register(np, policy, em);
+5 -2
drivers/thermal/db8500_thermal.c
··· 53 53 54 54 struct db8500_thermal_zone { 55 55 struct thermal_zone_device *tz; 56 + struct device *dev; 56 57 unsigned long interpolated_temp; 57 58 unsigned int cur_index; 58 59 }; ··· 115 114 idx -= 1; 116 115 117 116 db8500_thermal_update_config(th, idx, next_low, next_high); 118 - dev_dbg(&th->tz->device, 117 + dev_dbg(th->dev, 119 118 "PRCMU set max %ld, min %ld\n", next_high, next_low); 120 119 121 120 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); ··· 137 136 138 137 db8500_thermal_update_config(th, idx, next_low, next_high); 139 138 140 - dev_dbg(&th->tz->device, 139 + dev_dbg(th->dev, 141 140 "PRCMU set max %ld, min %ld\n", next_high, next_low); 142 141 } else if (idx == num_points - 1) 143 142 /* So we roof out 1 degree over the max point */ ··· 157 156 th = devm_kzalloc(dev, sizeof(*th), GFP_KERNEL); 158 157 if (!th) 159 158 return -ENOMEM; 159 + 160 + th->dev = dev; 160 161 161 162 low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW"); 162 163 if (low_irq < 0)
+1 -1
drivers/thermal/devfreq_cooling.c
··· 20 20 #include <linux/thermal.h> 21 21 #include <linux/units.h> 22 22 23 - #include <trace/events/thermal.h> 23 + #include "thermal_trace.h" 24 24 25 25 #define SCALE_ERROR_MITIGATION 100 26 26
+1 -1
drivers/thermal/gov_fair_share.c
··· 11 11 */ 12 12 13 13 #include <linux/thermal.h> 14 - #include <trace/events/thermal.h> 14 + #include "thermal_trace.h" 15 15 16 16 #include "thermal_core.h" 17 17
+1 -1
drivers/thermal/gov_power_allocator.c
··· 12 12 #include <linux/thermal.h> 13 13 14 14 #define CREATE_TRACE_POINTS 15 - #include <trace/events/thermal_power_allocator.h> 15 + #include "thermal_trace_ipa.h" 16 16 17 17 #include "thermal_core.h" 18 18
+1 -1
drivers/thermal/gov_step_wise.c
··· 12 12 13 13 #include <linux/thermal.h> 14 14 #include <linux/minmax.h> 15 - #include <trace/events/thermal.h> 15 + #include "thermal_trace.h" 16 16 17 17 #include "thermal_core.h" 18 18
+1 -3
drivers/thermal/hisi_thermal.c
··· 544 544 { 545 545 struct hisi_thermal_data *data; 546 546 struct device *dev = &pdev->dev; 547 - struct resource *res; 548 547 int i, ret; 549 548 550 549 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); ··· 554 555 platform_set_drvdata(pdev, data); 555 556 data->ops = of_device_get_match_data(dev); 556 557 557 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 558 - data->regs = devm_ioremap_resource(dev, res); 558 + data->regs = devm_platform_ioremap_resource(pdev, 0); 559 559 if (IS_ERR(data->regs)) 560 560 return PTR_ERR(data->regs); 561 561
+1 -1
drivers/thermal/imx8mm_thermal.c
··· 282 282 * strongly recommended to update such old DTs to get correct 283 283 * temperature compensation values for each SoC. 284 284 */ 285 - if (!of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) { 285 + if (!of_property_present(pdev->dev.of_node, "nvmem-cells")) { 286 286 dev_warn(dev, 287 287 "No OCOTP nvmem reference found, SoC-specific calibration not loaded. Please update your DT.\n"); 288 288 return 0;
+9 -14
drivers/thermal/imx_thermal.c
··· 330 330 return 0; 331 331 } 332 332 333 - static int imx_get_crit_temp(struct thermal_zone_device *tz, int *temp) 334 - { 335 - *temp = trips[IMX_TRIP_CRITICAL].temperature; 336 - 337 - return 0; 338 - } 339 - 340 - static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip, 333 + static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip_id, 341 334 int temp) 342 335 { 343 336 struct imx_thermal_data *data = thermal_zone_device_priv(tz); 337 + struct thermal_trip trip; 344 338 int ret; 345 339 346 340 ret = pm_runtime_resume_and_get(data->dev); 347 341 if (ret < 0) 348 342 return ret; 349 343 344 + ret = __thermal_zone_get_trip(tz, trip_id, &trip); 345 + if (ret) 346 + return ret; 347 + 350 348 /* do not allow changing critical threshold */ 351 - if (trip == IMX_TRIP_CRITICAL) 349 + if (trip.type == THERMAL_TRIP_CRITICAL) 352 350 return -EPERM; 353 351 354 352 /* do not allow passive to be set higher than critical */ 355 353 if (temp < 0 || temp > trips[IMX_TRIP_CRITICAL].temperature) 356 354 return -EINVAL; 357 - 358 - trips[IMX_TRIP_PASSIVE].temperature = temp; 359 355 360 356 imx_set_alarm_temp(data, temp); 361 357 ··· 380 384 .unbind = imx_unbind, 381 385 .get_temp = imx_get_temp, 382 386 .change_mode = imx_change_mode, 383 - .get_crit_temp = imx_get_crit_temp, 384 387 .set_trip_temp = imx_set_trip_temp, 385 388 }; 386 389 ··· 566 571 567 572 np = of_get_cpu_node(data->policy->cpu, NULL); 568 573 569 - if (!np || !of_find_property(np, "#cooling-cells", NULL)) { 574 + if (!np || !of_property_present(np, "#cooling-cells")) { 570 575 data->cdev = cpufreq_cooling_register(data->policy); 571 576 if (IS_ERR(data->cdev)) { 572 577 ret = PTR_ERR(data->cdev); ··· 643 648 644 649 platform_set_drvdata(pdev, data); 645 650 646 - if (of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) { 651 + if (of_property_present(pdev->dev.of_node, "nvmem-cells")) { 647 652 ret = imx_init_from_nvmem_cells(pdev); 648 653 if (ret) 649 654 return dev_err_probe(&pdev->dev, ret,
+90 -17
drivers/thermal/mediatek/auxadc_thermal.c
··· 31 31 #define AUXADC_CON2_V 0x010 32 32 #define AUXADC_DATA(channel) (0x14 + (channel) * 4) 33 33 34 + #define APMIXED_SYS_TS_CON0 0x600 34 35 #define APMIXED_SYS_TS_CON1 0x604 35 36 36 37 /* Thermal Controller Registers */ ··· 282 281 /* The calibration coefficient of sensor */ 283 282 #define MT7986_CALIBRATION 165 284 283 284 + /* MT8365 */ 285 + #define MT8365_TEMP_AUXADC_CHANNEL 11 286 + #define MT8365_CALIBRATION 164 287 + #define MT8365_NUM_CONTROLLER 1 288 + #define MT8365_NUM_BANKS 1 289 + #define MT8365_NUM_SENSORS 3 290 + #define MT8365_NUM_SENSORS_PER_ZONE 3 291 + #define MT8365_TS1 0 292 + #define MT8365_TS2 1 293 + #define MT8365_TS3 2 294 + 285 295 struct mtk_thermal; 286 296 287 297 struct thermal_bank_cfg { ··· 319 307 bool need_switch_bank; 320 308 struct thermal_bank_cfg bank_data[MAX_NUM_ZONES]; 321 309 enum mtk_thermal_version version; 310 + u32 apmixed_buffer_ctl_reg; 311 + u32 apmixed_buffer_ctl_mask; 312 + u32 apmixed_buffer_ctl_set; 322 313 }; 323 314 324 315 struct mtk_thermal { ··· 447 432 static const int mt7986_vts_index[MT7986_NUM_SENSORS] = { VTS1 }; 448 433 static const int mt7986_tc_offset[MT7986_NUM_CONTROLLER] = { 0x0, }; 449 434 435 + /* MT8365 thermal sensor data */ 436 + static const int mt8365_bank_data[MT8365_NUM_SENSORS] = { 437 + MT8365_TS1, MT8365_TS2, MT8365_TS3 438 + }; 439 + 440 + static const int mt8365_msr[MT8365_NUM_SENSORS_PER_ZONE] = { 441 + TEMP_MSR0, TEMP_MSR1, TEMP_MSR2 442 + }; 443 + 444 + static const int mt8365_adcpnp[MT8365_NUM_SENSORS_PER_ZONE] = { 445 + TEMP_ADCPNP0, TEMP_ADCPNP1, TEMP_ADCPNP2 446 + }; 447 + 448 + static const int mt8365_mux_values[MT8365_NUM_SENSORS] = { 0, 1, 2 }; 449 + static const int mt8365_tc_offset[MT8365_NUM_CONTROLLER] = { 0 }; 450 + 451 + static const int mt8365_vts_index[MT8365_NUM_SENSORS] = { VTS1, VTS2, VTS3 }; 452 + 450 453 /* 451 454 * The MT8173 thermal controller has four banks. Each bank can read up to 452 455 * four temperature sensors simultaneously. The MT8173 has a total of 5 ··· 540 507 }; 541 508 542 509 /* 510 + * The MT8365 thermal controller has one bank, which can read up to 511 + * four temperature sensors simultaneously. The MT8365 has a total of 3 512 + * temperature sensors. 513 + * 514 + * The thermal core only gets the maximum temperature of this one bank, 515 + * so the bank concept wouldn't be necessary here. However, the SVS (Smart 516 + * Voltage Scaling) unit makes its decisions based on the same bank 517 + * data. 518 + */ 519 + static const struct mtk_thermal_data mt8365_thermal_data = { 520 + .auxadc_channel = MT8365_TEMP_AUXADC_CHANNEL, 521 + .num_banks = MT8365_NUM_BANKS, 522 + .num_sensors = MT8365_NUM_SENSORS, 523 + .vts_index = mt8365_vts_index, 524 + .cali_val = MT8365_CALIBRATION, 525 + .num_controller = MT8365_NUM_CONTROLLER, 526 + .controller_offset = mt8365_tc_offset, 527 + .need_switch_bank = false, 528 + .bank_data = { 529 + { 530 + .num_sensors = MT8365_NUM_SENSORS, 531 + .sensors = mt8365_bank_data 532 + }, 533 + }, 534 + .msr = mt8365_msr, 535 + .adcpnp = mt8365_adcpnp, 536 + .sensor_mux_values = mt8365_mux_values, 537 + .version = MTK_THERMAL_V1, 538 + .apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON0, 539 + .apmixed_buffer_ctl_mask = (u32) ~GENMASK(29, 28), 540 + .apmixed_buffer_ctl_set = 0, 541 + }; 542 + 543 + /* 543 544 * The MT2712 thermal controller has one bank, which can read up to 544 545 * four temperature sensors simultaneously. The MT2712 has a total of 4 545 546 * temperature sensors. ··· 627 560 .adcpnp = mt7622_adcpnp, 628 561 .sensor_mux_values = mt7622_mux_values, 629 562 .version = MTK_THERMAL_V2, 563 + .apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1, 564 + .apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3), 565 + .apmixed_buffer_ctl_set = BIT(0), 630 566 }; 631 567 632 568 /* ··· 815 745 temp = mt->raw_to_mcelsius( 816 746 mt, conf->bank_data[bank->id].sensors[i], raw); 817 747 818 - 819 - /* 820 - * The first read of a sensor often contains very high bogus 821 - * temperature value. Filter these out so that the system does 822 - * not immediately shut down. 823 - */ 824 - if (temp > 200000) 825 - temp = 0; 826 748 827 749 if (temp > max) 828 750 max = temp; ··· 1136 1074 { 1137 1075 .compatible = "mediatek,mt8183-thermal", 1138 1076 .data = (void *)&mt8183_thermal_data, 1077 + }, 1078 + { 1079 + .compatible = "mediatek,mt8365-thermal", 1080 + .data = (void *)&mt8365_thermal_data, 1139 1081 }, { 1140 1082 }, 1141 1083 }; 1142 1084 MODULE_DEVICE_TABLE(of, mtk_thermal_of_match); 1143 1085 1144 - static void mtk_thermal_turn_on_buffer(void __iomem *apmixed_base) 1086 + static void mtk_thermal_turn_on_buffer(struct mtk_thermal *mt, 1087 + void __iomem *apmixed_base) 1145 1088 { 1146 - int tmp; 1089 + u32 tmp; 1147 1090 1148 - tmp = readl(apmixed_base + APMIXED_SYS_TS_CON1); 1149 - tmp &= ~(0x37); 1150 - tmp |= 0x1; 1151 - writel(tmp, apmixed_base + APMIXED_SYS_TS_CON1); 1091 + if (!mt->conf->apmixed_buffer_ctl_reg) 1092 + return; 1093 + 1094 + tmp = readl(apmixed_base + mt->conf->apmixed_buffer_ctl_reg); 1095 + tmp &= mt->conf->apmixed_buffer_ctl_mask; 1096 + tmp |= mt->conf->apmixed_buffer_ctl_set; 1097 + writel(tmp, apmixed_base + mt->conf->apmixed_buffer_ctl_reg); 1152 1098 udelay(200); 1153 1099 } 1154 1100 ··· 1254 1184 goto err_disable_clk_auxadc; 1255 1185 } 1256 1186 1257 - if (mt->conf->version != MTK_THERMAL_V1) { 1258 - mtk_thermal_turn_on_buffer(apmixed_base); 1187 + mtk_thermal_turn_on_buffer(mt, apmixed_base); 1188 + 1189 + if (mt->conf->version != MTK_THERMAL_V2) 1259 1190 mtk_thermal_release_periodic_ts(mt, auxadc_base); 1260 - } 1261 1191 1262 1192 if (mt->conf->version == MTK_THERMAL_V1) 1263 1193 mt->raw_to_mcelsius = raw_to_mcelsius_v1; ··· 1272 1202 auxadc_phys_base, ctrl_id); 1273 1203 1274 1204 platform_set_drvdata(pdev, mt); 1205 + 1206 + /* Delay for thermal banks to be ready */ 1207 + msleep(30); 1275 1208 1276 1209 tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt, 1277 1210 &mtk_thermal_ops);
+2 -50
drivers/thermal/rcar_gen3_thermal.c
··· 14 14 #include <linux/of_device.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/pm_runtime.h> 17 - #include <linux/sys_soc.h> 18 17 #include <linux/thermal.h> 19 18 20 19 #include "thermal_hwmon.h" ··· 26 27 #define REG_GEN3_IRQTEMP1 0x14 27 28 #define REG_GEN3_IRQTEMP2 0x18 28 29 #define REG_GEN3_IRQTEMP3 0x1C 29 - #define REG_GEN3_CTSR 0x20 30 30 #define REG_GEN3_THCTR 0x20 31 31 #define REG_GEN3_TEMP 0x28 32 32 #define REG_GEN3_THCODE1 0x50 ··· 43 45 #define IRQ_TEMPD1 BIT(3) 44 46 #define IRQ_TEMPD2 BIT(4) 45 47 #define IRQ_TEMPD3 BIT(5) 46 - 47 - /* CTSR bits */ 48 - #define CTSR_PONM BIT(8) 49 - #define CTSR_AOUT BIT(7) 50 - #define CTSR_THBGR BIT(5) 51 - #define CTSR_VMEN BIT(4) 52 - #define CTSR_VMST BIT(1) 53 - #define CTSR_THSST BIT(0) 54 48 55 49 /* THCTR bits */ 56 50 #define THCTR_PONM BIT(6) ··· 78 88 struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; 79 89 struct thermal_zone_device_ops ops; 80 90 unsigned int num_tscs; 81 - void (*thermal_init)(struct rcar_gen3_thermal_priv *priv, 82 - struct rcar_gen3_thermal_tsc *tsc); 83 91 int ptat[3]; 84 92 }; 85 93 ··· 236 248 return IRQ_HANDLED; 237 249 } 238 250 239 - static const struct soc_device_attribute r8a7795es1[] = { 240 - { .soc_id = "r8a7795", .revision = "ES1.*" }, 241 - { /* sentinel */ } 242 - }; 243 - 244 251 static bool rcar_gen3_thermal_read_fuses(struct rcar_gen3_thermal_priv *priv) 245 252 { 246 253 unsigned int i; ··· 292 309 } 293 310 294 311 return true; 295 - } 296 - 297 - static void rcar_gen3_thermal_init_r8a7795es1(struct rcar_gen3_thermal_priv *priv, 298 - struct rcar_gen3_thermal_tsc *tsc) 299 - { 300 - rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_THBGR); 301 - rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, 0x0); 302 - 303 - usleep_range(1000, 2000); 304 - 305 - rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_PONM); 306 - 307 - rcar_gen3_thermal_write(tsc, REG_GEN3_IRQCTL, 0x3F); 308 - rcar_gen3_thermal_write(tsc, REG_GEN3_IRQMSK, 0); 309 - if (priv->ops.set_trips) 310 - rcar_gen3_thermal_write(tsc, REG_GEN3_IRQEN, 311 - IRQ_TEMPD1 | IRQ_TEMP2); 312 - 313 - rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, 314 - CTSR_PONM | CTSR_AOUT | CTSR_THBGR | CTSR_VMEN); 315 - 316 - usleep_range(100, 200); 317 - 318 - rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, 319 - CTSR_PONM | CTSR_AOUT | CTSR_THBGR | CTSR_VMEN | 320 - CTSR_VMST | CTSR_THSST); 321 - 322 - usleep_range(1000, 2000); 323 312 } 324 313 325 314 static void rcar_gen3_thermal_init(struct rcar_gen3_thermal_priv *priv, ··· 429 474 return -ENOMEM; 430 475 431 476 priv->ops = rcar_gen3_tz_of_ops; 432 - priv->thermal_init = rcar_gen3_thermal_init; 433 - if (soc_device_match(r8a7795es1)) 434 - priv->thermal_init = rcar_gen3_thermal_init_r8a7795es1; 435 477 436 478 platform_set_drvdata(pdev, priv); 437 479 ··· 468 516 for (i = 0; i < priv->num_tscs; i++) { 469 517 struct rcar_gen3_thermal_tsc *tsc = priv->tscs[i]; 470 518 471 - priv->thermal_init(priv, tsc); 519 + rcar_gen3_thermal_init(priv, tsc); 472 520 rcar_gen3_thermal_calc_coefs(priv, tsc, *ths_tj_1); 473 521 474 522 zone = devm_thermal_of_zone_register(dev, i, tsc, &priv->ops); ··· 515 563 for (i = 0; i < priv->num_tscs; i++) { 516 564 struct rcar_gen3_thermal_tsc *tsc = priv->tscs[i]; 517 565 518 - priv->thermal_init(priv, tsc); 566 + rcar_gen3_thermal_init(priv, tsc); 519 567 } 520 568 521 569 return 0;
-1
drivers/thermal/st/stm_thermal.c
··· 558 558 * Thermal_zone doesn't enable hwmon as default, 559 559 * enable it here 560 560 */ 561 - sensor->th_dev->tzp->no_hwmon = false; 562 561 ret = thermal_add_hwmon_sysfs(sensor->th_dev); 563 562 if (ret) 564 563 goto err_tz;
+3 -7
drivers/thermal/thermal_core.c
··· 22 22 #include <linux/suspend.h> 23 23 24 24 #define CREATE_TRACE_POINTS 25 - #include <trace/events/thermal.h> 25 + #include "thermal_trace.h" 26 26 27 27 #include "thermal_core.h" 28 28 #include "thermal_hwmon.h" ··· 826 826 const struct thermal_zone_params *tzp; 827 827 struct thermal_zone_device *pos = NULL; 828 828 829 - mutex_lock(&thermal_list_lock); 830 - 831 829 list_for_each_entry(pos, &thermal_tz_list, node) { 832 830 if (!pos->tzp && !pos->ops->bind) 833 831 continue; ··· 852 854 tzp->tbp[i].weight); 853 855 } 854 856 } 855 - 856 - mutex_unlock(&thermal_list_lock); 857 857 } 858 858 859 859 /** ··· 929 933 930 934 /* Add 'this' new cdev to the global cdev list */ 931 935 mutex_lock(&thermal_list_lock); 936 + 932 937 list_add(&cdev->node, &thermal_cdev_list); 933 - mutex_unlock(&thermal_list_lock); 934 938 935 939 /* Update binding information for 'this' new cdev */ 936 940 bind_cdev(cdev); 937 941 938 - mutex_lock(&thermal_list_lock); 939 942 list_for_each_entry(pos, &thermal_tz_list, node) 940 943 if (atomic_cmpxchg(&pos->need_update, 1, 0)) 941 944 thermal_zone_device_update(pos, 942 945 THERMAL_EVENT_UNSPECIFIED); 946 + 943 947 mutex_unlock(&thermal_list_lock); 944 948 945 949 return cdev;
+1 -2
drivers/thermal/thermal_helpers.c
··· 19 19 #include <linux/string.h> 20 20 #include <linux/sysfs.h> 21 21 22 - #include <trace/events/thermal.h> 23 - 24 22 #include "thermal_core.h" 23 + #include "thermal_trace.h" 25 24 26 25 int get_tz_trend(struct thermal_zone_device *tz, int trip) 27 26 {
+2 -2
drivers/thermal/thermal_hwmon.c
··· 229 229 hwmon = thermal_hwmon_lookup_by_type(tz); 230 230 if (unlikely(!hwmon)) { 231 231 /* Should never happen... */ 232 - dev_dbg(hwmon->device, "hwmon device lookup failed!\n"); 232 + dev_dbg(&tz->device, "hwmon device lookup failed!\n"); 233 233 return; 234 234 } 235 235 236 236 temp = thermal_hwmon_lookup_temp(hwmon, tz); 237 237 if (unlikely(!temp)) { 238 238 /* Should never happen... */ 239 - dev_dbg(hwmon->device, "temperature input lookup failed!\n"); 239 + dev_dbg(&tz->device, "temperature input lookup failed!\n"); 240 240 return; 241 241 } 242 242
+5 -5
drivers/thermal/ti-soc-thermal/ti-thermal-common.c
··· 23 23 #include "ti-bandgap.h" 24 24 #include "../thermal_hwmon.h" 25 25 26 + #define TI_BANDGAP_UPDATE_INTERVAL_MS 250 27 + 26 28 /* common data structures */ 27 29 struct ti_thermal_data { 28 30 struct cpufreq_policy *policy; ··· 161 159 char *domain) 162 160 { 163 161 struct ti_thermal_data *data; 164 - int interval; 165 162 166 163 data = ti_bandgap_get_sensor_data(bgp, id); 167 164 ··· 178 177 return PTR_ERR(data->ti_thermal); 179 178 } 180 179 181 - interval = jiffies_to_msecs(data->ti_thermal->polling_delay_jiffies); 182 - 183 180 ti_bandgap_set_sensor_data(bgp, id, data); 184 - ti_bandgap_write_update_interval(bgp, data->sensor_id, interval); 181 + ti_bandgap_write_update_interval(bgp, data->sensor_id, 182 + TI_BANDGAP_UPDATE_INTERVAL_MS); 185 183 186 184 if (devm_thermal_add_hwmon_sysfs(bgp->dev, data->ti_thermal)) 187 185 dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n"); ··· 223 223 * using DT, then it must be aware that the cooling device 224 224 * loading has to happen via cpufreq driver. 225 225 */ 226 - if (of_find_property(np, "#thermal-sensor-cells", NULL)) 226 + if (of_property_present(np, "#thermal-sensor-cells")) 227 227 return 0; 228 228 229 229 data = ti_bandgap_get_sensor_data(bgp, id);
+6
include/trace/events/thermal.h drivers/thermal/thermal_trace.h
··· 195 195 #endif /* CONFIG_DEVFREQ_THERMAL */ 196 196 #endif /* _TRACE_THERMAL_H */ 197 197 198 + #undef TRACE_INCLUDE_PATH 199 + #define TRACE_INCLUDE_PATH . 200 + 201 + #undef TRACE_INCLUDE_FILE 202 + #define TRACE_INCLUDE_FILE thermal_trace 203 + 198 204 /* This part must be outside protection */ 199 205 #include <trace/define_trace.h>
+6
include/trace/events/thermal_power_allocator.h drivers/thermal/thermal_trace_ipa.h
··· 84 84 ); 85 85 #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */ 86 86 87 + #undef TRACE_INCLUDE_PATH 88 + #define TRACE_INCLUDE_PATH . 89 + 90 + #undef TRACE_INCLUDE_FILE 91 + #define TRACE_INCLUDE_FILE thermal_trace_ipa 92 + 87 93 /* This part must be outside protection */ 88 94 #include <trace/define_trace.h>