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

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

Pull thermal control updates from Rafael Wysocki:
"These rework the Intel DTS IOSF and the ACPI thermal drivers to pass
tables of generic trip point structures to the core during
initialization and make some requisite modifications in the thermal
core, fix a few issues elsewhere and clean up code.

This includes changes that are present in the ACPI updates too,
because they involve both ACPI and the thermal core. The list of
specific changes below is limited to thermal control, however.

Specifics:

- Make the ACPI thermal driver use its own Notify() handler (Michal
Wilczynski)

- Rework the ACPI thermal driver to use a table of generic trip point
structures on top of the internal representation of trip points and
remove thermal zone callbacks that are not necessary any more from
that driver (Rafael Wysocki)

- Fix a few issues in the Intel DTS IOSF thermal driver, clean up
code in it and make it pass tables of generic trip point structures
to the core during thermal zone registration (Rafael Wysocki)

- Drop a redundant check from the Intel DTS IOSF thermal driver's
"remove" routine (Zhang Rui)

- Use module_platform_driver() to replace an open-coded counterpart
of it in the int340x thermal driver (Yang Yingliang)

- Fix possible uninitialized value access in __thermal_of_bind() and
__thermal_of_unbind() (Peng Fan)

- Make the int3400 driver use thermal zone device wrappers (Daniel
Lezcano)

- Remove redundant thermal zone state check from the int340x thermal
driver (Daniel Lezcano)

- Drop non-functional nocrt parameter from ACPI thermal (Mario
Limonciello)

- Explicitly include correct DT includes in the thermal core and
drivers (Rob Herring)"

* tag 'thermal-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
thermal: intel: intel_soc_dts_iosf: Remove redundant check
thermal: intel: int340x: simplify the code with module_platform_driver()
thermal/of: Fix potential uninitialized value access
thermal: intel: intel_soc_dts_iosf: Use struct thermal_trip
thermal: intel: intel_soc_dts_iosf: Rework critical trip setup
thermal: intel: intel_soc_dts_iosf: Add helper for resetting trip points
thermal: intel: intel_soc_dts_iosf: Change initialization ordering
thermal: intel: intel_soc_dts_iosf: Pass sensors to update_trip_temp()
thermal: intel: intel_soc_dts_iosf: Untangle update_trip_temp()
thermal: intel: intel_soc_dts_iosf: Always assume notification support
thermal: intel: intel_soc_dts_iosf: Drop redundant symbol definition
thermal: intel: intel_soc_dts_iosf: Always use 2 trips
thermal: Explicitly include correct DT includes
thermal/drivers/int340x: Do not check the thermal zone state
thermal/drivers/int3400: Use thermal zone device wrappers

+123 -205
-2
drivers/thermal/amlogic_thermal.c
··· 22 22 #include <linux/mfd/syscon.h> 23 23 #include <linux/module.h> 24 24 #include <linux/of.h> 25 - #include <linux/of_address.h> 26 - #include <linux/of_device.h> 27 25 #include <linux/platform_device.h> 28 26 #include <linux/regmap.h> 29 27 #include <linux/thermal.h>
+1 -1
drivers/thermal/broadcom/bcm2711_thermal.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/mfd/syscon.h> 17 17 #include <linux/module.h> 18 + #include <linux/of.h> 18 19 #include <linux/platform_device.h> 19 - #include <linux/of_device.h> 20 20 #include <linux/regmap.h> 21 21 #include <linux/thermal.h> 22 22
+1 -1
drivers/thermal/broadcom/brcmstb_thermal.c
··· 17 17 #include <linux/interrupt.h> 18 18 #include <linux/kernel.h> 19 19 #include <linux/module.h> 20 + #include <linux/of.h> 20 21 #include <linux/platform_device.h> 21 - #include <linux/of_device.h> 22 22 #include <linux/thermal.h> 23 23 24 24 #define AVS_TMON_STATUS 0x00
+1 -1
drivers/thermal/hisi_thermal.c
··· 13 13 #include <linux/delay.h> 14 14 #include <linux/interrupt.h> 15 15 #include <linux/module.h> 16 + #include <linux/of.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/io.h> 18 - #include <linux/of_device.h> 19 19 #include <linux/thermal.h> 20 20 21 21 #define HI6220_TEMP0_LAG (0x0)
-1
drivers/thermal/imx8mm_thermal.c
··· 12 12 #include <linux/module.h> 13 13 #include <linux/nvmem-consumer.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_device.h> 16 15 #include <linux/platform_device.h> 17 16 #include <linux/slab.h> 18 17 #include <linux/thermal.h>
-1
drivers/thermal/imx_sc_thermal.c
··· 8 8 #include <linux/firmware/imx/sci.h> 9 9 #include <linux/module.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/platform_device.h> 13 12 #include <linux/slab.h> 14 13 #include <linux/thermal.h>
+1 -1
drivers/thermal/imx_thermal.c
··· 11 11 #include <linux/mfd/syscon.h> 12 12 #include <linux/module.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 14 + #include <linux/platform_device.h> 15 15 #include <linux/regmap.h> 16 16 #include <linux/thermal.h> 17 17 #include <linux/nvmem-consumer.h>
+22 -22
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
··· 15 15 #define INT3400_THERMAL_TABLE_CHANGED 0x83 16 16 #define INT3400_ODVP_CHANGED 0x88 17 17 #define INT3400_KEEP_ALIVE 0xA0 18 + #define INT3400_FAKE_TEMP (20 * 1000) /* faked temp sensor with 20C */ 18 19 19 20 enum int3400_thermal_uuid { 20 21 INT3400_THERMAL_ACTIVE = 0, ··· 454 453 void *data) 455 454 { 456 455 struct int3400_thermal_priv *priv = data; 456 + struct device *dev; 457 457 char *thermal_prop[5]; 458 458 int therm_event; 459 459 ··· 477 475 return; 478 476 } 479 477 480 - thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", priv->thermal->type); 481 - thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", priv->thermal->temperature); 478 + dev = thermal_zone_device(priv->thermal); 479 + 480 + thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", thermal_zone_device_type(priv->thermal)); 481 + thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", INT3400_FAKE_TEMP); 482 482 thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP="); 483 483 thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", therm_event); 484 484 thermal_prop[4] = NULL; 485 - kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, thermal_prop); 485 + kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, thermal_prop); 486 486 kfree(thermal_prop[0]); 487 487 kfree(thermal_prop[1]); 488 488 kfree(thermal_prop[2]); ··· 494 490 static int int3400_thermal_get_temp(struct thermal_zone_device *thermal, 495 491 int *temp) 496 492 { 497 - *temp = 20 * 1000; /* faked temp sensor with 20C */ 493 + *temp = INT3400_FAKE_TEMP; 498 494 return 0; 499 495 } 500 496 ··· 503 499 { 504 500 struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal); 505 501 int result = 0; 502 + int enabled; 506 503 507 504 if (!priv) 508 505 return -EINVAL; 509 506 510 - if (mode != thermal->mode) { 511 - int enabled; 507 + enabled = mode == THERMAL_DEVICE_ENABLED; 512 508 513 - enabled = mode == THERMAL_DEVICE_ENABLED; 514 - 515 - if (priv->os_uuid_mask) { 516 - if (!enabled) { 517 - priv->os_uuid_mask = 0; 518 - result = set_os_uuid_mask(priv, priv->os_uuid_mask); 519 - } 520 - goto eval_odvp; 509 + if (priv->os_uuid_mask) { 510 + if (!enabled) { 511 + priv->os_uuid_mask = 0; 512 + result = set_os_uuid_mask(priv, priv->os_uuid_mask); 521 513 } 522 - 523 - if (priv->current_uuid_index < 0 || 524 - priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID) 525 - return -EINVAL; 526 - 527 - result = int3400_thermal_run_osc(priv->adev->handle, 528 - int3400_thermal_uuids[priv->current_uuid_index], 529 - &enabled); 514 + goto eval_odvp; 530 515 } 531 516 517 + if (priv->current_uuid_index < 0 || 518 + priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID) 519 + return -EINVAL; 520 + 521 + result = int3400_thermal_run_osc(priv->adev->handle, 522 + int3400_thermal_uuids[priv->current_uuid_index], 523 + &enabled); 532 524 eval_odvp: 533 525 evaluate_odvp(priv); 534 526
+1 -12
drivers/thermal/intel/int340x_thermal/int3401_thermal.c
··· 70 70 }, 71 71 }; 72 72 73 - static int __init proc_thermal_init(void) 74 - { 75 - return platform_driver_register(&int3401_driver); 76 - } 77 - 78 - static void __exit proc_thermal_exit(void) 79 - { 80 - platform_driver_unregister(&int3401_driver); 81 - } 82 - 83 - module_init(proc_thermal_init); 84 - module_exit(proc_thermal_exit); 73 + module_platform_driver(int3401_driver); 85 74 86 75 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>"); 87 76 MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
+1 -1
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
··· 59 59 * ACPI/MSR. So we don't want to fail for auxiliary DTSs. 60 60 */ 61 61 proc_priv->soc_dts = intel_soc_dts_iosf_init( 62 - INTEL_SOC_DTS_INTERRUPT_MSI, 2, 0); 62 + INTEL_SOC_DTS_INTERRUPT_MSI, false, 0); 63 63 64 64 if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) { 65 65 ret = pci_enable_msi(pdev);
+70 -118
drivers/thermal/intel/intel_soc_dts_iosf.c
··· 37 37 /* DTS encoding for TJ MAX temperature */ 38 38 #define SOC_DTS_TJMAX_ENCODING 0x7F 39 39 40 - /* Only 2 out of 4 is allowed for OSPM */ 41 - #define SOC_MAX_DTS_TRIPS 2 42 - 43 40 /* Mask for two trips in status bits */ 44 41 #define SOC_DTS_TRIP_MASK 0x03 45 42 46 - /* DTS0 and DTS 1 */ 47 - #define SOC_MAX_DTS_SENSORS 2 48 - 49 - static int sys_get_trip_temp(struct thermal_zone_device *tzd, int trip, 50 - int *temp) 51 - { 52 - int status; 53 - u32 out; 54 - struct intel_soc_dts_sensor_entry *dts; 55 - struct intel_soc_dts_sensors *sensors; 56 - 57 - dts = thermal_zone_device_priv(tzd); 58 - sensors = dts->sensors; 59 - mutex_lock(&sensors->dts_update_lock); 60 - status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, 61 - SOC_DTS_OFFSET_PTPS, &out); 62 - mutex_unlock(&sensors->dts_update_lock); 63 - if (status) 64 - return status; 65 - 66 - out = (out >> (trip * 8)) & SOC_DTS_TJMAX_ENCODING; 67 - if (!out) 68 - *temp = 0; 69 - else 70 - *temp = sensors->tj_max - out * 1000; 71 - 72 - return 0; 73 - } 74 - 75 - static int update_trip_temp(struct intel_soc_dts_sensor_entry *dts, 76 - int thres_index, int temp, 77 - enum thermal_trip_type trip_type) 43 + static int update_trip_temp(struct intel_soc_dts_sensors *sensors, 44 + int thres_index, int temp) 78 45 { 79 46 int status; 80 47 u32 temp_out; ··· 52 85 u32 store_te_out; 53 86 u32 te_out; 54 87 u32 int_enable_bit = SOC_DTS_TE_APICA_ENABLE; 55 - struct intel_soc_dts_sensors *sensors = dts->sensors; 56 88 57 89 if (sensors->intr_type == INTEL_SOC_DTS_INTERRUPT_MSI) 58 90 int_enable_bit |= SOC_DTS_TE_MSI_ENABLE; ··· 114 148 if (status) 115 149 goto err_restore_te_out; 116 150 117 - dts->trip_types[thres_index] = trip_type; 118 - 119 151 return 0; 120 152 err_restore_te_out: 121 153 iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, ··· 129 165 return status; 130 166 } 131 167 168 + static int configure_trip(struct intel_soc_dts_sensor_entry *dts, 169 + int thres_index, enum thermal_trip_type trip_type, 170 + int temp) 171 + { 172 + int ret; 173 + 174 + ret = update_trip_temp(dts->sensors, thres_index, temp); 175 + if (ret) 176 + return ret; 177 + 178 + dts->trips[thres_index].temperature = temp; 179 + dts->trips[thres_index].type = trip_type; 180 + 181 + return 0; 182 + } 183 + 132 184 static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, 133 185 int temp) 134 186 { ··· 156 176 return -EINVAL; 157 177 158 178 mutex_lock(&sensors->dts_update_lock); 159 - status = update_trip_temp(dts, trip, temp, 160 - dts->trip_types[trip]); 179 + status = update_trip_temp(sensors, trip, temp); 161 180 mutex_unlock(&sensors->dts_update_lock); 162 181 163 182 return status; 164 - } 165 - 166 - static int sys_get_trip_type(struct thermal_zone_device *tzd, 167 - int trip, enum thermal_trip_type *type) 168 - { 169 - struct intel_soc_dts_sensor_entry *dts = thermal_zone_device_priv(tzd); 170 - 171 - *type = dts->trip_types[trip]; 172 - 173 - return 0; 174 183 } 175 184 176 185 static int sys_get_curr_temp(struct thermal_zone_device *tzd, ··· 186 217 187 218 static struct thermal_zone_device_ops tzone_ops = { 188 219 .get_temp = sys_get_curr_temp, 189 - .get_trip_temp = sys_get_trip_temp, 190 - .get_trip_type = sys_get_trip_type, 191 220 .set_trip_temp = sys_set_trip_temp, 192 221 }; 193 222 ··· 212 245 213 246 static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts) 214 247 { 215 - if (dts) { 216 - iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, 217 - SOC_DTS_OFFSET_ENABLE, dts->store_status); 218 - thermal_zone_device_unregister(dts->tzone); 219 - } 248 + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, 249 + SOC_DTS_OFFSET_ENABLE, dts->store_status); 250 + thermal_zone_device_unregister(dts->tzone); 220 251 } 221 252 222 253 static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts, 223 - bool notification_support, int trip_cnt, 224 - int read_only_trip_cnt) 254 + bool critical_trip) 225 255 { 256 + int writable_trip_cnt = SOC_MAX_DTS_TRIPS; 226 257 char name[10]; 227 258 unsigned long trip; 228 - int trip_count = 0; 229 - int trip_mask = 0; 230 - int writable_trip_cnt = 0; 259 + int trip_mask; 231 260 unsigned long ptps; 232 261 u32 store_ptps; 233 262 unsigned long i; ··· 236 273 goto err_ret; 237 274 238 275 dts->id = id; 239 - if (notification_support) { 240 - trip_count = min(SOC_MAX_DTS_TRIPS, trip_cnt); 241 - writable_trip_cnt = trip_count - read_only_trip_cnt; 242 - trip_mask = GENMASK(writable_trip_cnt - 1, 0); 243 - } 276 + 277 + if (critical_trip) 278 + writable_trip_cnt--; 279 + 280 + trip_mask = GENMASK(writable_trip_cnt - 1, 0); 244 281 245 282 /* Check if the writable trip we provide is not used by BIOS */ 246 283 ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, ··· 253 290 trip_mask &= ~BIT(i / 8); 254 291 } 255 292 dts->trip_mask = trip_mask; 256 - dts->trip_count = trip_count; 257 293 snprintf(name, sizeof(name), "soc_dts%d", id); 258 - dts->tzone = thermal_zone_device_register(name, 259 - trip_count, 260 - trip_mask, 261 - dts, &tzone_ops, 262 - NULL, 0, 0); 294 + dts->tzone = thermal_zone_device_register_with_trips(name, dts->trips, 295 + SOC_MAX_DTS_TRIPS, 296 + trip_mask, 297 + dts, &tzone_ops, 298 + NULL, 0, 0); 263 299 if (IS_ERR(dts->tzone)) { 264 300 ret = PTR_ERR(dts->tzone); 265 301 goto err_ret; ··· 277 315 err_ret: 278 316 return ret; 279 317 } 280 - 281 - int intel_soc_dts_iosf_add_read_only_critical_trip( 282 - struct intel_soc_dts_sensors *sensors, int critical_offset) 283 - { 284 - int i, j; 285 - 286 - for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { 287 - struct intel_soc_dts_sensor_entry *entry = &sensors->soc_dts[i]; 288 - int temp = sensors->tj_max - critical_offset; 289 - unsigned long count = entry->trip_count; 290 - unsigned long mask = entry->trip_mask; 291 - 292 - j = find_first_zero_bit(&mask, count); 293 - if (j < count) 294 - return update_trip_temp(entry, j, temp, THERMAL_TRIP_CRITICAL); 295 - } 296 - 297 - return -EINVAL; 298 - } 299 - EXPORT_SYMBOL_GPL(intel_soc_dts_iosf_add_read_only_critical_trip); 300 318 301 319 void intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors *sensors) 302 320 { ··· 313 371 } 314 372 EXPORT_SYMBOL_GPL(intel_soc_dts_iosf_interrupt_handler); 315 373 316 - struct intel_soc_dts_sensors *intel_soc_dts_iosf_init( 317 - enum intel_soc_dts_interrupt_type intr_type, int trip_count, 318 - int read_only_trip_count) 374 + static void dts_trips_reset(struct intel_soc_dts_sensors *sensors, int dts_index) 375 + { 376 + configure_trip(&sensors->soc_dts[dts_index], 0, 0, 0); 377 + configure_trip(&sensors->soc_dts[dts_index], 1, 0, 0); 378 + } 379 + 380 + struct intel_soc_dts_sensors * 381 + intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type, 382 + bool critical_trip, int crit_offset) 319 383 { 320 384 struct intel_soc_dts_sensors *sensors; 321 - bool notification; 322 385 int tj_max; 323 386 int ret; 324 387 int i; 325 388 326 389 if (!iosf_mbi_available()) 327 390 return ERR_PTR(-ENODEV); 328 - 329 - if (!trip_count || read_only_trip_count > trip_count) 330 - return ERR_PTR(-EINVAL); 331 391 332 392 tj_max = intel_tcc_get_tjmax(-1); 333 393 if (tj_max < 0) ··· 343 399 mutex_init(&sensors->dts_update_lock); 344 400 sensors->intr_type = intr_type; 345 401 sensors->tj_max = tj_max * 1000; 346 - if (intr_type == INTEL_SOC_DTS_INTERRUPT_NONE) 347 - notification = false; 348 - else 349 - notification = true; 402 + 350 403 for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { 404 + enum thermal_trip_type trip_type; 405 + int temp; 406 + 351 407 sensors->soc_dts[i].sensors = sensors; 352 - ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], 353 - notification, trip_count, 354 - read_only_trip_count); 408 + 409 + ret = configure_trip(&sensors->soc_dts[i], 0, 410 + THERMAL_TRIP_PASSIVE, 0); 355 411 if (ret) 356 - goto err_free; 412 + goto err_reset_trips; 413 + 414 + if (critical_trip) { 415 + trip_type = THERMAL_TRIP_CRITICAL; 416 + temp = sensors->tj_max - crit_offset; 417 + } else { 418 + trip_type = THERMAL_TRIP_PASSIVE; 419 + temp = 0; 420 + } 421 + ret = configure_trip(&sensors->soc_dts[i], 1, trip_type, temp); 422 + if (ret) 423 + goto err_reset_trips; 357 424 } 358 425 359 426 for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { 360 - ret = update_trip_temp(&sensors->soc_dts[i], 0, 0, 361 - THERMAL_TRIP_PASSIVE); 362 - if (ret) 363 - goto err_remove_zone; 364 - 365 - ret = update_trip_temp(&sensors->soc_dts[i], 1, 0, 366 - THERMAL_TRIP_PASSIVE); 427 + ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], critical_trip); 367 428 if (ret) 368 429 goto err_remove_zone; 369 430 } 370 431 371 432 return sensors; 433 + 372 434 err_remove_zone: 373 435 for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) 374 436 remove_dts_thermal_zone(&sensors->soc_dts[i]); 375 437 376 - err_free: 438 + err_reset_trips: 439 + for (i = 0; i < SOC_MAX_DTS_SENSORS; i++) 440 + dts_trips_reset(sensors, i); 441 + 377 442 kfree(sensors); 378 443 return ERR_PTR(ret); 379 444 } ··· 393 440 int i; 394 441 395 442 for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { 396 - update_trip_temp(&sensors->soc_dts[i], 0, 0, 0); 397 - update_trip_temp(&sensors->soc_dts[i], 1, 0, 0); 398 443 remove_dts_thermal_zone(&sensors->soc_dts[i]); 444 + dts_trips_reset(sensors, i); 399 445 } 400 446 kfree(sensors); 401 447 }
+8 -7
drivers/thermal/intel/intel_soc_dts_iosf.h
··· 12 12 /* DTS0 and DTS 1 */ 13 13 #define SOC_MAX_DTS_SENSORS 2 14 14 15 + /* Only 2 out of 4 is allowed for OSPM */ 16 + #define SOC_MAX_DTS_TRIPS 2 17 + 15 18 enum intel_soc_dts_interrupt_type { 16 19 INTEL_SOC_DTS_INTERRUPT_NONE, 17 20 INTEL_SOC_DTS_INTERRUPT_APIC, ··· 29 26 int id; 30 27 u32 store_status; 31 28 u32 trip_mask; 32 - u32 trip_count; 33 - enum thermal_trip_type trip_types[2]; 29 + struct thermal_trip trips[SOC_MAX_DTS_TRIPS]; 34 30 struct thermal_zone_device *tzone; 35 31 struct intel_soc_dts_sensors *sensors; 36 32 }; ··· 42 40 struct intel_soc_dts_sensor_entry soc_dts[SOC_MAX_DTS_SENSORS]; 43 41 }; 44 42 45 - struct intel_soc_dts_sensors *intel_soc_dts_iosf_init( 46 - enum intel_soc_dts_interrupt_type intr_type, int trip_count, 47 - int read_only_trip_count); 43 + 44 + struct intel_soc_dts_sensors * 45 + intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type, 46 + bool critical_trip, int crit_offset); 48 47 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors); 49 48 void intel_soc_dts_iosf_interrupt_handler( 50 49 struct intel_soc_dts_sensors *sensors); 51 - int intel_soc_dts_iosf_add_read_only_critical_trip( 52 - struct intel_soc_dts_sensors *sensors, int critical_offset); 53 50 #endif
+2 -15
drivers/thermal/intel/intel_soc_dts_thermal.c
··· 51 51 return -ENODEV; 52 52 53 53 /* Create a zone with 2 trips with marked as read only */ 54 - soc_dts = intel_soc_dts_iosf_init(INTEL_SOC_DTS_INTERRUPT_APIC, 2, 1); 54 + soc_dts = intel_soc_dts_iosf_init(INTEL_SOC_DTS_INTERRUPT_APIC, true, 55 + crit_offset); 55 56 if (IS_ERR(soc_dts)) { 56 57 err = PTR_ERR(soc_dts); 57 58 return err; ··· 89 88 } 90 89 } 91 90 92 - err = intel_soc_dts_iosf_add_read_only_critical_trip(soc_dts, 93 - crit_offset); 94 - if (err) 95 - goto error_trips; 96 - 97 91 return 0; 98 - 99 - error_trips: 100 - if (soc_dts_thres_irq) { 101 - free_irq(soc_dts_thres_irq, soc_dts); 102 - acpi_unregister_gsi(soc_dts_thres_gsi); 103 - } 104 - intel_soc_dts_iosf_exit(soc_dts); 105 - 106 - return err; 107 92 } 108 93 109 94 static void __exit intel_soc_thermal_exit(void)
+1 -1
drivers/thermal/k3_bandgap.c
··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/module.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_platform.h> 14 + #include <linux/platform_device.h> 15 15 #include <linux/pm_runtime.h> 16 16 #include <linux/thermal.h> 17 17 #include <linux/types.h>
+1 -1
drivers/thermal/k3_j72xx_bandgap.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/init.h> 12 12 #include <linux/kernel.h> 13 + #include <linux/platform_device.h> 13 14 #include <linux/pm_runtime.h> 14 15 #include <linux/err.h> 15 16 #include <linux/types.h> 16 - #include <linux/of_platform.h> 17 17 #include <linux/io.h> 18 18 #include <linux/thermal.h> 19 19 #include <linux/of.h>
-1
drivers/thermal/mediatek/auxadc_thermal.c
··· 15 15 #include <linux/nvmem-consumer.h> 16 16 #include <linux/of.h> 17 17 #include <linux/of_address.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/platform_device.h> 20 19 #include <linux/slab.h> 21 20 #include <linux/io.h>
+1 -1
drivers/thermal/mediatek/lvts_thermal.c
··· 13 13 #include <linux/iopoll.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/nvmem-consumer.h> 16 - #include <linux/of_device.h> 16 + #include <linux/of.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/reset.h> 19 19 #include <linux/thermal.h>
-1
drivers/thermal/qcom/qcom-spmi-adc-tm5.c
··· 14 14 #include <linux/interrupt.h> 15 15 #include <linux/module.h> 16 16 #include <linux/of.h> 17 - #include <linux/of_device.h> 18 17 #include <linux/platform_device.h> 19 18 #include <linux/regmap.h> 20 19 #include <linux/thermal.h>
-1
drivers/thermal/qcom/qcom-spmi-temp-alarm.c
··· 10 10 #include <linux/interrupt.h> 11 11 #include <linux/module.h> 12 12 #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/platform_device.h> 15 14 #include <linux/regmap.h> 16 15 #include <linux/thermal.h>
+1 -1
drivers/thermal/rcar_gen3_thermal.c
··· 11 11 #include <linux/interrupt.h> 12 12 #include <linux/io.h> 13 13 #include <linux/module.h> 14 - #include <linux/of_device.h> 14 + #include <linux/of.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/pm_runtime.h> 17 17 #include <linux/thermal.h>
+1 -1
drivers/thermal/rcar_thermal.c
··· 11 11 #include <linux/interrupt.h> 12 12 #include <linux/io.h> 13 13 #include <linux/module.h> 14 - #include <linux/of_device.h> 14 + #include <linux/of.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/pm_runtime.h> 17 17 #include <linux/reboot.h>
+1 -1
drivers/thermal/rzg2l_thermal.c
··· 9 9 #include <linux/io.h> 10 10 #include <linux/iopoll.h> 11 11 #include <linux/math.h> 12 + #include <linux/mod_devicetable.h> 12 13 #include <linux/module.h> 13 - #include <linux/of_device.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/pm_runtime.h> 16 16 #include <linux/reset.h>
+1 -1
drivers/thermal/samsung/exynos_tmu.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/interrupt.h> 17 17 #include <linux/module.h> 18 - #include <linux/of_device.h> 18 + #include <linux/of.h> 19 19 #include <linux/of_address.h> 20 20 #include <linux/of_irq.h> 21 21 #include <linux/platform_device.h>
+1 -1
drivers/thermal/sprd_thermal.c
··· 6 6 #include <linux/iopoll.h> 7 7 #include <linux/module.h> 8 8 #include <linux/nvmem-consumer.h> 9 - #include <linux/of_device.h> 9 + #include <linux/of.h> 10 10 #include <linux/platform_device.h> 11 11 #include <linux/slab.h> 12 12 #include <linux/thermal.h>
-2
drivers/thermal/st/stm_thermal.c
··· 14 14 #include <linux/iopoll.h> 15 15 #include <linux/module.h> 16 16 #include <linux/of.h> 17 - #include <linux/of_address.h> 18 - #include <linux/of_device.h> 19 17 #include <linux/platform_device.h> 20 18 #include <linux/thermal.h> 21 19
+1 -1
drivers/thermal/sun8i_thermal.c
··· 14 14 #include <linux/interrupt.h> 15 15 #include <linux/module.h> 16 16 #include <linux/nvmem-consumer.h> 17 - #include <linux/of_device.h> 17 + #include <linux/of.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/regmap.h> 20 20 #include <linux/reset.h>
+1 -1
drivers/thermal/tegra/tegra30-tsensor.c
··· 18 18 #include <linux/iopoll.h> 19 19 #include <linux/math.h> 20 20 #include <linux/module.h> 21 - #include <linux/of_device.h> 21 + #include <linux/of.h> 22 22 #include <linux/platform_device.h> 23 23 #include <linux/pm.h> 24 24 #include <linux/reset.h>
+5 -6
drivers/thermal/thermal_of.c
··· 10 10 11 11 #include <linux/err.h> 12 12 #include <linux/export.h> 13 - #include <linux/of_device.h> 14 - #include <linux/of_platform.h> 13 + #include <linux/of.h> 15 14 #include <linux/slab.h> 16 15 #include <linux/thermal.h> 17 16 #include <linux/types.h> ··· 291 292 ret = of_parse_phandle_with_args(map_np, "cooling-device", "#cooling-cells", 292 293 index, &cooling_spec); 293 294 294 - of_node_put(cooling_spec.np); 295 - 296 295 if (ret < 0) { 297 296 pr_err("Invalid cooling-device entry\n"); 298 297 return ret; 299 298 } 299 + 300 + of_node_put(cooling_spec.np); 300 301 301 302 if (cooling_spec.args_count < 2) { 302 303 pr_err("wrong reference to cooling device, missing limits\n"); ··· 324 325 ret = of_parse_phandle_with_args(map_np, "cooling-device", "#cooling-cells", 325 326 index, &cooling_spec); 326 327 327 - of_node_put(cooling_spec.np); 328 - 329 328 if (ret < 0) { 330 329 pr_err("Invalid cooling-device entry\n"); 331 330 return ret; 332 331 } 332 + 333 + of_node_put(cooling_spec.np); 333 334 334 335 if (cooling_spec.args_count < 2) { 335 336 pr_err("wrong reference to cooling device, missing limits\n");
-1
drivers/thermal/uniphier_thermal.c
··· 12 12 #include <linux/mfd/syscon.h> 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_device.h> 16 15 #include <linux/platform_device.h> 17 16 #include <linux/regmap.h> 18 17 #include <linux/thermal.h>