Skip to content

Commit 3653478

Browse files
committed
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
2 parents ccc5e98 + d081228 commit 3653478

29 files changed

+123
-205
lines changed

drivers/thermal/amlogic_thermal.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#include <linux/mfd/syscon.h>
2323
#include <linux/module.h>
2424
#include <linux/of.h>
25-
#include <linux/of_address.h>
26-
#include <linux/of_device.h>
2725
#include <linux/platform_device.h>
2826
#include <linux/regmap.h>
2927
#include <linux/thermal.h>

drivers/thermal/broadcom/bcm2711_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include <linux/kernel.h>
1616
#include <linux/mfd/syscon.h>
1717
#include <linux/module.h>
18+
#include <linux/of.h>
1819
#include <linux/platform_device.h>
19-
#include <linux/of_device.h>
2020
#include <linux/regmap.h>
2121
#include <linux/thermal.h>
2222

drivers/thermal/broadcom/brcmstb_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <linux/interrupt.h>
1818
#include <linux/kernel.h>
1919
#include <linux/module.h>
20+
#include <linux/of.h>
2021
#include <linux/platform_device.h>
21-
#include <linux/of_device.h>
2222
#include <linux/thermal.h>
2323

2424
#define AVS_TMON_STATUS 0x00

drivers/thermal/hisi_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include <linux/delay.h>
1414
#include <linux/interrupt.h>
1515
#include <linux/module.h>
16+
#include <linux/of.h>
1617
#include <linux/platform_device.h>
1718
#include <linux/io.h>
18-
#include <linux/of_device.h>
1919
#include <linux/thermal.h>
2020

2121
#define HI6220_TEMP0_LAG (0x0)

drivers/thermal/imx8mm_thermal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/module.h>
1313
#include <linux/nvmem-consumer.h>
1414
#include <linux/of.h>
15-
#include <linux/of_device.h>
1615
#include <linux/platform_device.h>
1716
#include <linux/slab.h>
1817
#include <linux/thermal.h>

drivers/thermal/imx_sc_thermal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <linux/firmware/imx/sci.h>
99
#include <linux/module.h>
1010
#include <linux/of.h>
11-
#include <linux/of_device.h>
1211
#include <linux/platform_device.h>
1312
#include <linux/slab.h>
1413
#include <linux/thermal.h>

drivers/thermal/imx_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/mfd/syscon.h>
1212
#include <linux/module.h>
1313
#include <linux/of.h>
14-
#include <linux/of_device.h>
14+
#include <linux/platform_device.h>
1515
#include <linux/regmap.h>
1616
#include <linux/thermal.h>
1717
#include <linux/nvmem-consumer.h>

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define INT3400_THERMAL_TABLE_CHANGED 0x83
1616
#define INT3400_ODVP_CHANGED 0x88
1717
#define INT3400_KEEP_ALIVE 0xA0
18+
#define INT3400_FAKE_TEMP (20 * 1000) /* faked temp sensor with 20C */
1819

1920
enum int3400_thermal_uuid {
2021
INT3400_THERMAL_ACTIVE = 0,
@@ -453,6 +454,7 @@ static void int3400_notify(acpi_handle handle,
453454
void *data)
454455
{
455456
struct int3400_thermal_priv *priv = data;
457+
struct device *dev;
456458
char *thermal_prop[5];
457459
int therm_event;
458460

@@ -475,12 +477,14 @@ static void int3400_notify(acpi_handle handle,
475477
return;
476478
}
477479

478-
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", priv->thermal->type);
479-
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", priv->thermal->temperature);
480+
dev = thermal_zone_device(priv->thermal);
481+
482+
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", thermal_zone_device_type(priv->thermal));
483+
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", INT3400_FAKE_TEMP);
480484
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
481485
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", therm_event);
482486
thermal_prop[4] = NULL;
483-
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, thermal_prop);
487+
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, thermal_prop);
484488
kfree(thermal_prop[0]);
485489
kfree(thermal_prop[1]);
486490
kfree(thermal_prop[2]);
@@ -490,7 +494,7 @@ static void int3400_notify(acpi_handle handle,
490494
static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
491495
int *temp)
492496
{
493-
*temp = 20 * 1000; /* faked temp sensor with 20C */
497+
*temp = INT3400_FAKE_TEMP;
494498
return 0;
495499
}
496500

@@ -499,32 +503,28 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
499503
{
500504
struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal);
501505
int result = 0;
506+
int enabled;
502507

503508
if (!priv)
504509
return -EINVAL;
505510

506-
if (mode != thermal->mode) {
507-
int enabled;
508-
509-
enabled = mode == THERMAL_DEVICE_ENABLED;
511+
enabled = mode == THERMAL_DEVICE_ENABLED;
510512

511-
if (priv->os_uuid_mask) {
512-
if (!enabled) {
513-
priv->os_uuid_mask = 0;
514-
result = set_os_uuid_mask(priv, priv->os_uuid_mask);
515-
}
516-
goto eval_odvp;
513+
if (priv->os_uuid_mask) {
514+
if (!enabled) {
515+
priv->os_uuid_mask = 0;
516+
result = set_os_uuid_mask(priv, priv->os_uuid_mask);
517517
}
518-
519-
if (priv->current_uuid_index < 0 ||
520-
priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
521-
return -EINVAL;
522-
523-
result = int3400_thermal_run_osc(priv->adev->handle,
524-
int3400_thermal_uuids[priv->current_uuid_index],
525-
&enabled);
518+
goto eval_odvp;
526519
}
527520

521+
if (priv->current_uuid_index < 0 ||
522+
priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
523+
return -EINVAL;
524+
525+
result = int3400_thermal_run_osc(priv->adev->handle,
526+
int3400_thermal_uuids[priv->current_uuid_index],
527+
&enabled);
528528
eval_odvp:
529529
evaluate_odvp(priv);
530530

drivers/thermal/intel/int340x_thermal/int3401_thermal.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,7 @@ static struct platform_driver int3401_driver = {
7070
},
7171
};
7272

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);
8574

8675
MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
8776
MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");

drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
5959
* ACPI/MSR. So we don't want to fail for auxiliary DTSs.
6060
*/
6161
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);
6363

6464
if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) {
6565
ret = pci_enable_msi(pdev);

0 commit comments

Comments
 (0)