Skip to content

Commit cfeeb7d

Browse files
committed
Merge back general thermal control changes for 6.4-rc1.
2 parents 065ca2a + 75f74a9 commit cfeeb7d

20 files changed

Lines changed: 140 additions & 111 deletions

Documentation/devicetree/bindings/thermal/mediatek-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Required properties:
1616
- "mediatek,mt7981-thermal", "mediatek,mt7986-thermal" : For MT7981 SoC
1717
- "mediatek,mt7986-thermal" : For MT7986 SoC
1818
- "mediatek,mt8183-thermal" : For MT8183 family of SoCs
19+
- "mediatek,mt8365-thermal" : For MT8365 family of SoCs
1920
- "mediatek,mt8516-thermal", "mediatek,mt2701-thermal : For MT8516 family of SoCs
2021
- reg: Address range of the thermal controller
2122
- interrupts: IRQ for the thermal controller

drivers/thermal/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for sensor chip drivers.
44
#
5-
5+
CFLAGS_thermal_core.o := -I$(src)
66
obj-$(CONFIG_THERMAL) += thermal_sys.o
77
thermal_sys-y += thermal_core.o thermal_sysfs.o
88
thermal_sys-y += thermal_trip.o thermal_helpers.o
@@ -16,6 +16,7 @@ thermal_sys-$(CONFIG_THERMAL_OF) += thermal_of.o
1616
thermal_sys-$(CONFIG_THERMAL_ACPI) += thermal_acpi.o
1717

1818
# governors
19+
CFLAGS_gov_power_allocator.o := -I$(src)
1920
thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE) += gov_fair_share.o
2021
thermal_sys-$(CONFIG_THERMAL_GOV_BANG_BANG) += gov_bang_bang.o
2122
thermal_sys-$(CONFIG_THERMAL_GOV_STEP_WISE) += gov_step_wise.o

drivers/thermal/cpufreq_cooling.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <linux/thermal.h>
2424
#include <linux/units.h>
2525

26-
#include <trace/events/thermal.h>
26+
#include "thermal_trace.h"
2727

2828
/*
2929
* Cooling state <-> CPUFreq frequency
@@ -633,7 +633,7 @@ of_cpufreq_cooling_register(struct cpufreq_policy *policy)
633633
return NULL;
634634
}
635635

636-
if (of_find_property(np, "#cooling-cells", NULL)) {
636+
if (of_property_present(np, "#cooling-cells")) {
637637
struct em_perf_domain *em = em_cpu_get(policy->cpu);
638638

639639
cdev = __cpufreq_cooling_register(np, policy, em);

drivers/thermal/db8500_thermal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ static const unsigned long db8500_thermal_points[] = {
5353

5454
struct db8500_thermal_zone {
5555
struct thermal_zone_device *tz;
56+
struct device *dev;
5657
unsigned long interpolated_temp;
5758
unsigned int cur_index;
5859
};
@@ -114,7 +115,7 @@ static irqreturn_t prcmu_low_irq_handler(int irq, void *irq_data)
114115
idx -= 1;
115116

116117
db8500_thermal_update_config(th, idx, next_low, next_high);
117-
dev_dbg(&th->tz->device,
118+
dev_dbg(th->dev,
118119
"PRCMU set max %ld, min %ld\n", next_high, next_low);
119120

120121
thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED);
@@ -136,7 +137,7 @@ static irqreturn_t prcmu_high_irq_handler(int irq, void *irq_data)
136137

137138
db8500_thermal_update_config(th, idx, next_low, next_high);
138139

139-
dev_dbg(&th->tz->device,
140+
dev_dbg(th->dev,
140141
"PRCMU set max %ld, min %ld\n", next_high, next_low);
141142
} else if (idx == num_points - 1)
142143
/* So we roof out 1 degree over the max point */
@@ -157,6 +158,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
157158
if (!th)
158159
return -ENOMEM;
159160

161+
th->dev = dev;
162+
160163
low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW");
161164
if (low_irq < 0)
162165
return low_irq;

drivers/thermal/devfreq_cooling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <linux/thermal.h>
2121
#include <linux/units.h>
2222

23-
#include <trace/events/thermal.h>
23+
#include "thermal_trace.h"
2424

2525
#define SCALE_ERROR_MITIGATION 100
2626

drivers/thermal/gov_fair_share.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
#include <linux/thermal.h>
14-
#include <trace/events/thermal.h>
14+
#include "thermal_trace.h"
1515

1616
#include "thermal_core.h"
1717

drivers/thermal/gov_power_allocator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/thermal.h>
1313

1414
#define CREATE_TRACE_POINTS
15-
#include <trace/events/thermal_power_allocator.h>
15+
#include "thermal_trace_ipa.h"
1616

1717
#include "thermal_core.h"
1818

drivers/thermal/gov_step_wise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <linux/thermal.h>
1414
#include <linux/minmax.h>
15-
#include <trace/events/thermal.h>
15+
#include "thermal_trace.h"
1616

1717
#include "thermal_core.h"
1818

drivers/thermal/hisi_thermal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ static int hisi_thermal_probe(struct platform_device *pdev)
544544
{
545545
struct hisi_thermal_data *data;
546546
struct device *dev = &pdev->dev;
547-
struct resource *res;
548547
int i, ret;
549548

550549
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -555,8 +554,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
555554
platform_set_drvdata(pdev, data);
556555
data->ops = of_device_get_match_data(dev);
557556

558-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
559-
data->regs = devm_ioremap_resource(dev, res);
557+
data->regs = devm_platform_ioremap_resource(pdev, 0);
560558
if (IS_ERR(data->regs))
561559
return PTR_ERR(data->regs);
562560

drivers/thermal/imx8mm_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int imx8mm_tmu_probe_set_calib(struct platform_device *pdev,
282282
* strongly recommended to update such old DTs to get correct
283283
* temperature compensation values for each SoC.
284284
*/
285-
if (!of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) {
285+
if (!of_property_present(pdev->dev.of_node, "nvmem-cells")) {
286286
dev_warn(dev,
287287
"No OCOTP nvmem reference found, SoC-specific calibration not loaded. Please update your DT.\n");
288288
return 0;

0 commit comments

Comments
 (0)