Skip to content

Commit 74dd4d1

Browse files
committed
Merge tag 'thermal-v7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal control updates for 6.20/7.0 from Daniel Lezcano: "- Fix CFLAGS and LDFLAGS in the pkg-config template fir the libthermal (Romain Gantois) - Support multiple temp to raw conversion functions for the Mediatek LVTS thermal driver and add the MT8196 and MT6991 support (Laura Nao) - Add support for the Mediatek LVTS driver for MT7987 (Frank Wunderlich) - Use the existing HZ_PER_MHZ macro on STM32 (Andy Shevchenko) - Use the existing clamp() macro in BCM2835 (Thorsten Blum) - Make the reset line optional in order to support new Renesas Soc where it is not available. Add the RZ/T2H and RZ/N2H suppport (Cosmin Tanislav)" * tag 'thermal-v7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal: renesas: rzg3e: add support for RZ/T2H and RZ/N2H dt-bindings: thermal: r9a09g047-tsu: document RZ/T2H and RZ/N2H thermal: renesas: rzg3e: make calibration value retrieval per-chip thermal: renesas: rzg3e: make min and max temperature per-chip thermal: renesas: rzg3e: make reset optional dt-bindings: thermal: r9a09g047-tsu: Document RZ/V2N TSU thermal/drivers/broadcom: Use clamp to simplify bcm2835_thermal_temp2adc thermal/drivers/stm32: Use predefined HZ_PER_MHZ instead of a custom one thermal/drivers/mediatek/lvts_thermal: Add mt7987 support dt-bindings: thermal: mediatek: Add LVTS thermal controller definition for MT7987 dt-bindings: nvmem: mediatek: efuse: Add support for MT8196 thermal/drivers/mediatek/lvts_thermal: Add MT8196 support thermal/drivers/mediatek/lvts: Support MSR offset for 16-bit calibration data thermal/drivers/mediatek/lvts: Add support for ATP mode thermal/drivers/mediatek/lvts: Add lvts_temp_to_raw variant thermal/drivers/mediatek/lvts: Add platform ops to support alternative conversion logic thermal/drivers/mediatek/lvts: Make number of calibration offsets configurable dt-bindings: thermal: mediatek: Add LVTS thermal controller support for MT8196 tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template
2 parents a1fe789 + 0061030 commit 74dd4d1

9 files changed

Lines changed: 483 additions & 85 deletions

File tree

Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- enum:
2929
- mediatek,mt8188-efuse
3030
- mediatek,mt8189-efuse
31+
- mediatek,mt8196-efuse
3132
- const: mediatek,mt8186-efuse
3233
- const: mediatek,mt8186-efuse
3334

Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ description: |
1818
properties:
1919
compatible:
2020
enum:
21+
- mediatek,mt7987-lvts-ap
2122
- mediatek,mt7988-lvts-ap
2223
- mediatek,mt8186-lvts
2324
- mediatek,mt8188-lvts-ap
@@ -26,6 +27,8 @@ properties:
2627
- mediatek,mt8192-lvts-mcu
2728
- mediatek,mt8195-lvts-ap
2829
- mediatek,mt8195-lvts-mcu
30+
- mediatek,mt8196-lvts-ap
31+
- mediatek,mt8196-lvts-mcu
2932

3033
reg:
3134
maxItems: 1

Documentation/devicetree/bindings/thermal/renesas,r9a09g047-tsu.yaml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ description:
1717
properties:
1818
compatible:
1919
oneOf:
20-
- const: renesas,r9a09g047-tsu # RZ/G3E
20+
- enum:
21+
- renesas,r9a09g047-tsu # RZ/G3E
22+
- renesas,r9a09g077-tsu # RZ/T2H
2123
- items:
22-
- const: renesas,r9a09g057-tsu # RZ/V2H
24+
- enum:
25+
- renesas,r9a09g056-tsu # RZ/V2N
26+
- renesas,r9a09g057-tsu # RZ/V2H
2327
- const: renesas,r9a09g047-tsu # RZ/G3E
28+
- items:
29+
- const: renesas,r9a09g087-tsu # RZ/N2H
30+
- const: renesas,r9a09g077-tsu # RZ/T2H
2431

2532
reg:
2633
maxItems: 1
@@ -63,12 +70,31 @@ required:
6370
- compatible
6471
- reg
6572
- clocks
66-
- resets
6773
- power-domains
6874
- interrupts
6975
- interrupt-names
7076
- "#thermal-sensor-cells"
71-
- renesas,tsu-trim
77+
78+
allOf:
79+
- if:
80+
properties:
81+
compatible:
82+
contains:
83+
const: renesas,r9a09g047-tsu
84+
then:
85+
required:
86+
- resets
87+
- renesas,tsu-trim
88+
89+
- if:
90+
properties:
91+
compatible:
92+
contains:
93+
const: renesas,r9a09g077-tsu
94+
then:
95+
properties:
96+
resets: false
97+
renesas,tsu-trim: false
7298

7399
additionalProperties: false
74100

drivers/thermal/broadcom/bcm2835_thermal.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/err.h>
1212
#include <linux/io.h>
1313
#include <linux/kernel.h>
14+
#include <linux/minmax.h>
1415
#include <linux/module.h>
1516
#include <linux/of.h>
1617
#include <linux/of_address.h>
@@ -80,12 +81,7 @@ static int bcm2835_thermal_temp2adc(int temp, int offset, int slope)
8081
temp -= offset;
8182
temp /= slope;
8283

83-
if (temp < 0)
84-
temp = 0;
85-
if (temp >= BIT(BCM2835_TS_TSENSSTAT_DATA_BITS))
86-
temp = BIT(BCM2835_TS_TSENSSTAT_DATA_BITS) - 1;
87-
88-
return temp;
84+
return clamp(temp, 0, (int)BIT(BCM2835_TS_TSENSSTAT_DATA_BITS) - 1);
8985
}
9086

9187
static int bcm2835_thermal_get_temp(struct thermal_zone_device *tz, int *temp)

0 commit comments

Comments
 (0)