Skip to content

Commit 75f74a9

Browse files
committed
Merge tag 'thermal-v6.4-rc1-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal control material for 6.4-rc1 from Daniel Lezcano: "- Add more thermal zone device encapsulation: prevent setting structure field directly, access the sensor device instead the thermal zone's device for trace, relocate the traces in drivers/thermal (Daniel Lezcano) - Use the generic trip point for the i.MX and remove the get_trip_temp ops (Daniel Lezcano) - Use the devm_platform_ioremap_resource() in the Hisilicon driver (Yang Li) - Remove R-Car H3 ES1.* handling as public has only access to the ES2 version and the upstream support for the ES1 has been shutdown (Wolfram Sang) - Add a delay after initializing the bank in order to let the time to the hardware to initialze itself before reading the temperature (Amjad Ouled-Ameur) - Add MT8365 support (Amjad Ouled-Ameur)" * tag 'thermal-v6.4-rc1-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/ti: Use fixed update interval thermal/drivers/stm: Don't set no_hwmon to false thermal/drivers/db8500: Use driver dev instead of tz->device thermal/core: Relocate the traces definition in thermal directory thermal/drivers/hisi: Use devm_platform_ioremap_resource() thermal/drivers/imx: Use the thermal framework for the trip point thermal/drivers/imx: Remove get_trip_temp ops thermal/drivers/rcar_gen3_thermal: Remove R-Car H3 ES1.* handling thermal/drivers/mediatek: Add delay after thermal banks initialization thermal/drivers/mediatek: Add support for MT8365 SoC thermal/drivers/mediatek: Control buffer enablement tweaks dt-bindings: thermal: mediatek: Add binding documentation for MT8365 SoC
2 parents cd246fa + 0c492be commit 75f74a9

18 files changed

Lines changed: 131 additions & 98 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: 1 addition & 1 deletion
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

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/imx_thermal.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,33 +330,29 @@ static int imx_change_mode(struct thermal_zone_device *tz,
330330
return 0;
331331
}
332332

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,
341334
int temp)
342335
{
343336
struct imx_thermal_data *data = thermal_zone_device_priv(tz);
337+
struct thermal_trip trip;
344338
int ret;
345339

346340
ret = pm_runtime_resume_and_get(data->dev);
347341
if (ret < 0)
348342
return ret;
349343

344+
ret = __thermal_zone_get_trip(tz, trip_id, &trip);
345+
if (ret)
346+
return ret;
347+
350348
/* do not allow changing critical threshold */
351-
if (trip == IMX_TRIP_CRITICAL)
349+
if (trip.type == THERMAL_TRIP_CRITICAL)
352350
return -EPERM;
353351

354352
/* do not allow passive to be set higher than critical */
355353
if (temp < 0 || temp > trips[IMX_TRIP_CRITICAL].temperature)
356354
return -EINVAL;
357355

358-
trips[IMX_TRIP_PASSIVE].temperature = temp;
359-
360356
imx_set_alarm_temp(data, temp);
361357

362358
pm_runtime_put(data->dev);
@@ -384,7 +380,6 @@ static struct thermal_zone_device_ops imx_tz_ops = {
384380
.unbind = imx_unbind,
385381
.get_temp = imx_get_temp,
386382
.change_mode = imx_change_mode,
387-
.get_crit_temp = imx_get_crit_temp,
388383
.set_trip_temp = imx_set_trip_temp,
389384
};
390385

0 commit comments

Comments
 (0)