summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-04-10 14:00:36 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-04-10 14:00:36 +0300
commitcd1a3b2ff0553e987de71ff0aa675e418de22898 (patch)
tree87bf30efc2a869c01863196b7ffa7fe72dbdee36 /drivers
parentecc26ba41ce254479232c750f96968abddbbb6ab (diff)
parentbf746e2a41efd98668c97759e06d436ae5af5a82 (diff)
downloadlinux-cd1a3b2ff0553e987de71ff0aa675e418de22898.tar.xz
Merge tag 'thermal-v7.1-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Merge updates of assorted thermal drivers for 7.1-rc1 from Daniel Lezcano: "- Added an OF node address to output message to make sensor names more distinguishable (Alexander Stein) - Added hwmon support for the i.MX97 thermal sensor (Alexander Stein) - Clamped correctly the results when doing value/temperature conversion in the Spreadtrum driver (Thorsten Blum) - Added the SDM670 compatible DT bindings for the Tsens and the lMH drivers (Richard Acayan) - Added the SM8750 compatible DT bindings for the Tsens (Manaf Meethalavalappu Pallikunhi) - Added the Eliza SoC compatible DT bindings for the Tsens (Krzysztof Kozlowski) - Fixed inverted condition check on error in the Spear driver (Gopi Krishna Menon) - Converted the DT bindings documentation into DT schema (Gopi Krishna Menon) - Used max() macro to increase readibility in the Broadcom STB thermal sensor (Thorsten Blum) - Removed stale @trim_offset kernel-doc entry (John Madieu)" * tag 'thermal-v7.1-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal: renesas: rzg3e: Remove stale @trim_offset kernel-doc entry thermal/drivers/brcmstb_thermal: Use max to simplify brcmstb_get_temp dt-bindings: thermal: st,thermal-spear1340: convert to dtschema thermal/drivers/spear: Fix error condition for reading st,thermal-flags dt-bindings: thermal: qcom-tsens: Add Eliza SoC TSENS dt-bindings: thermal: qcom-tsens: Document the SM8750 Temperature Sensor thermal/drivers/sprd: Use min instead of clamp in sprd_thm_temp_to_rawdata dt-bindings: thermal: lmh: Add SDM670 compatible dt-bindings: thermal: tsens: add SDM670 compatible thermal/drivers/sprd: Fix raw temperature clamping in sprd_thm_rawdata_to_temp thermal/drivers/sprd: Fix temperature clamping in sprd_thm_temp_to_rawdata thermal/drivers/imx91: Add hwmon support thermal/of: Add OF node address to output message
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thermal/broadcom/brcmstb_thermal.c8
-rw-r--r--drivers/thermal/imx91_thermal.c4
-rw-r--r--drivers/thermal/renesas/rzg3e_thermal.c1
-rw-r--r--drivers/thermal/spear_thermal.c2
-rw-r--r--drivers/thermal/sprd_thermal.c6
-rw-r--r--drivers/thermal/thermal_of.c20
6 files changed, 21 insertions, 20 deletions
diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index f46f2ddc174e..a9ffa596f7c0 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -16,6 +16,7 @@
#include <linux/irqreturn.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
+#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -154,7 +155,7 @@ static int brcmstb_get_temp(struct thermal_zone_device *tz, int *temp)
{
struct brcmstb_thermal_priv *priv = thermal_zone_device_priv(tz);
u32 val;
- long t;
+ int t;
val = __raw_readl(priv->tmon_base + AVS_TMON_STATUS);
@@ -164,10 +165,7 @@ static int brcmstb_get_temp(struct thermal_zone_device *tz, int *temp)
val = (val & AVS_TMON_STATUS_data_msk) >> AVS_TMON_STATUS_data_shift;
t = avs_tmon_code_to_temp(priv, val);
- if (t < 0)
- *temp = 0;
- else
- *temp = t;
+ *temp = max(0, t);
return 0;
}
diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_thermal.c
index 9b20be03d6de..25915bb702be 100644
--- a/drivers/thermal/imx91_thermal.c
+++ b/drivers/thermal/imx91_thermal.c
@@ -17,6 +17,8 @@
#include <linux/thermal.h>
#include <linux/units.h>
+#include "thermal_hwmon.h"
+
#define REG_SET 0x4
#define REG_CLR 0x8
#define REG_TOG 0xc
@@ -318,6 +320,8 @@ static int imx91_tmu_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(tmu->tzd),
"failed to register thermal zone sensor\n");
+ devm_thermal_add_hwmon_sysfs(dev, tmu->tzd);
+
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/renesas/rzg3e_thermal.c
index dde021e283b7..f0e29fe633db 100644
--- a/drivers/thermal/renesas/rzg3e_thermal.c
+++ b/drivers/thermal/renesas/rzg3e_thermal.c
@@ -93,7 +93,6 @@ struct rzg3e_thermal_info {
* @info: chip type specific information
* @trmval0: calibration value 0 (b)
* @trmval1: calibration value 1 (c)
- * @trim_offset: offset for trim registers in syscon
* @lock: protects hardware access during conversions
*/
struct rzg3e_thermal_priv {
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index 603dadcd3df5..5e3e9c1f32f8 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -93,7 +93,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
int ret = 0, val;
- if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
+ if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) {
dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");
return -EINVAL;
}
diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c
index e546067c9621..d683fcb0f8ab 100644
--- a/drivers/thermal/sprd_thermal.c
+++ b/drivers/thermal/sprd_thermal.c
@@ -178,7 +178,7 @@ static int sprd_thm_sensor_calibration(struct device_node *np,
static int sprd_thm_rawdata_to_temp(struct sprd_thermal_sensor *sen,
u32 rawdata)
{
- clamp(rawdata, (u32)SPRD_THM_RAW_DATA_LOW, (u32)SPRD_THM_RAW_DATA_HIGH);
+ rawdata = clamp(rawdata, SPRD_THM_RAW_DATA_LOW, SPRD_THM_RAW_DATA_HIGH);
/*
* According to the thermal datasheet, the formula of converting
@@ -192,7 +192,7 @@ static int sprd_thm_temp_to_rawdata(int temp, struct sprd_thermal_sensor *sen)
{
u32 val;
- clamp(temp, (int)SPRD_THM_TEMP_LOW, (int)SPRD_THM_TEMP_HIGH);
+ temp = clamp(temp, SPRD_THM_TEMP_LOW, SPRD_THM_TEMP_HIGH);
/*
* According to the thermal datasheet, the formula of converting
@@ -201,7 +201,7 @@ static int sprd_thm_temp_to_rawdata(int temp, struct sprd_thermal_sensor *sen)
*/
val = (temp + sen->cal_offset) / sen->cal_slope;
- return clamp(val, val, (u32)(SPRD_THM_RAW_DATA_HIGH - 1));
+ return min(val, SPRD_THM_RAW_DATA_HIGH - 1);
}
static int sprd_thm_read_temp(struct thermal_zone_device *tz, int *temp)
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 6ebb83cb70b2..99085c806a1f 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -144,7 +144,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
count = of_count_phandle_with_args(child, "thermal-sensors",
"#thermal-sensor-cells");
if (count <= 0) {
- pr_err("%pOFn: missing thermal sensor\n", child);
+ pr_err("%pOFP: missing thermal sensor\n", child);
return ERR_PTR(-EINVAL);
}
@@ -156,14 +156,14 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
"#thermal-sensor-cells",
i, &sensor_specs);
if (ret < 0) {
- pr_err("%pOFn: Failed to read thermal-sensors cells: %d\n", child, ret);
+ pr_err("%pOFP: Failed to read thermal-sensors cells: %d\n", child, ret);
return ERR_PTR(ret);
}
of_node_put(sensor_specs.np);
if ((sensor == sensor_specs.np) && id == (sensor_specs.args_count ?
sensor_specs.args[0] : 0)) {
- pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, child);
+ pr_debug("sensor %pOFP id=%d belongs to %pOFP\n", sensor, id, child);
return no_free_ptr(child);
}
}
@@ -180,7 +180,7 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel
if (ret == -EINVAL) {
*pdelay = 0;
} else if (ret < 0) {
- pr_err("%pOFn: Couldn't get polling-delay-passive: %d\n", np, ret);
+ pr_err("%pOFP: Couldn't get polling-delay-passive: %d\n", np, ret);
return ret;
}
@@ -188,7 +188,7 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel
if (ret == -EINVAL) {
*delay = 0;
} else if (ret < 0) {
- pr_err("%pOFn: Couldn't get polling-delay: %d\n", np, ret);
+ pr_err("%pOFP: Couldn't get polling-delay: %d\n", np, ret);
return ret;
}
@@ -380,23 +380,23 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
np = of_thermal_zone_find(sensor, id);
if (IS_ERR(np)) {
if (PTR_ERR(np) != -ENODEV)
- pr_err("Failed to find thermal zone for %pOFn id=%d\n", sensor, id);
+ pr_err("Failed to find thermal zone for %pOFP id=%d\n", sensor, id);
return ERR_CAST(np);
}
trips = thermal_of_trips_init(np, &ntrips);
if (IS_ERR(trips)) {
- pr_err("Failed to parse trip points for %pOFn id=%d\n", sensor, id);
+ pr_err("Failed to parse trip points for %pOFP id=%d\n", sensor, id);
ret = PTR_ERR(trips);
goto out_of_node_put;
}
if (!trips)
- pr_info("No trip points found for %pOFn id=%d\n", sensor, id);
+ pr_info("No trip points found for %pOFP id=%d\n", sensor, id);
ret = thermal_of_monitor_init(np, &delay, &pdelay);
if (ret) {
- pr_err("Failed to initialize monitoring delays from %pOFn\n", np);
+ pr_err("Failed to initialize monitoring delays from %pOFP\n", np);
goto out_kfree_trips;
}
@@ -417,7 +417,7 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
pdelay, delay);
if (IS_ERR(tz)) {
ret = PTR_ERR(tz);
- pr_err("Failed to register thermal zone %pOFn: %d\n", np, ret);
+ pr_err("Failed to register thermal zone %pOFP: %d\n", np, ret);
goto out_kfree_trips;
}