* [PATCH v2 0/2] Add thermal sensors support for MT7981
@ 2025-07-02 21:48 Aleksander Jan Bajkowski
2025-07-02 21:48 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add " Aleksander Jan Bajkowski
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Aleksander Jan Bajkowski @ 2025-07-02 21:48 UTC (permalink / raw)
To: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
matthias.bgg, angelogioacchino.delregno, olek2, zhiyong.tao,
linux-iio, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
This patch adds support for the temperature sensor in the MT7981 SoC.
This sensor is exactly the same as the one in the MT7986.
Changes in v2:
- added fallback to an existing compatible string
- removed second patch as obsolete
Aleksander Jan Bajkowski (2):
dt-bindings: iio: adc: Add support for MT7981
arm64: dts: mediatek: add thermal sensor support on mt7981
.../iio/adc/mediatek,mt2701-auxadc.yaml | 1 +
arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 32 ++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletion(-)
--
2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] dt-bindings: iio: adc: Add support for MT7981
2025-07-02 21:48 [PATCH v2 0/2] Add thermal sensors support for MT7981 Aleksander Jan Bajkowski
@ 2025-07-02 21:48 ` Aleksander Jan Bajkowski
2025-07-02 22:01 ` David Lechner
2025-07-03 7:48 ` Krzysztof Kozlowski
2025-07-02 21:48 ` [PATCH v2 2/2] arm64: dts: mediatek: add thermal sensor support on mt7981 Aleksander Jan Bajkowski
2025-07-03 13:41 ` [PATCH v2 0/2] Add thermal sensors support for MT7981 Rob Herring (Arm)
2 siblings, 2 replies; 7+ messages in thread
From: Aleksander Jan Bajkowski @ 2025-07-02 21:48 UTC (permalink / raw)
To: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
matthias.bgg, angelogioacchino.delregno, olek2, zhiyong.tao,
linux-iio, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
The temperature sensor in the MT7981 is same as in the MT7986.
Add compatible string for mt7981.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
.../devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
index b489c984c1bb..ceb914dde15b 100644
--- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
@@ -26,6 +26,7 @@ properties:
- mediatek,mt2712-auxadc
- mediatek,mt6765-auxadc
- mediatek,mt7622-auxadc
+ - mediatek,mt7981-auxadc
- mediatek,mt7986-auxadc
- mediatek,mt8173-auxadc
- items:
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] arm64: dts: mediatek: add thermal sensor support on mt7981
2025-07-02 21:48 [PATCH v2 0/2] Add thermal sensors support for MT7981 Aleksander Jan Bajkowski
2025-07-02 21:48 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add " Aleksander Jan Bajkowski
@ 2025-07-02 21:48 ` Aleksander Jan Bajkowski
2025-07-03 7:47 ` Krzysztof Kozlowski
2025-07-03 13:41 ` [PATCH v2 0/2] Add thermal sensors support for MT7981 Rob Herring (Arm)
2 siblings, 1 reply; 7+ messages in thread
From: Aleksander Jan Bajkowski @ 2025-07-02 21:48 UTC (permalink / raw)
To: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
matthias.bgg, angelogioacchino.delregno, olek2, zhiyong.tao,
linux-iio, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
The temperature sensor in the MT7981 is same as in the MT7986.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 32 ++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
index 5cbea9cd411f..759b9e8059d9 100644
--- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
@@ -76,7 +76,7 @@ watchdog: watchdog@1001c000 {
#reset-cells = <1>;
};
- clock-controller@1001e000 {
+ apmixedsys: clock-controller@1001e000 {
compatible = "mediatek,mt7981-apmixedsys";
reg = <0 0x1001e000 0 0x1000>;
#clock-cells = <1>;
@@ -184,6 +184,32 @@ spi@1100b000 {
status = "disabled";
};
+ thermal@1100c800 {
+ compatible = "mediatek,mt7981-thermal",
+ "mediatek,mt7986-thermal";
+ reg = <0 0x1100c800 0 0x800>;
+ interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&infracfg CLK_INFRA_THERM_CK>,
+ <&infracfg CLK_INFRA_ADC_26M_CK>;
+ clock-names = "therm", "auxadc";
+ nvmem-cells = <&thermal_calibration>;
+ nvmem-cell-names = "calibration-data";
+ #thermal-sensor-cells = <1>;
+ mediatek,auxadc = <&auxadc>;
+ mediatek,apmixedsys = <&apmixedsys>;
+ };
+
+ auxadc: adc@1100d000 {
+ compatible = "mediatek,mt7981-auxadc",
+ "mediatek,mt7986-auxadc",
+ "mediatek,mt7622-auxadc";
+ reg = <0 0x1100d000 0 0x1000>;
+ clocks = <&infracfg CLK_INFRA_ADC_26M_CK>;
+ clock-names = "main";
+ #io-channel-cells = <1>;
+ status = "disabled";
+ };
+
pio: pinctrl@11d00000 {
compatible = "mediatek,mt7981-pinctrl";
reg = <0 0x11d00000 0 0x1000>,
@@ -211,6 +237,10 @@ efuse@11f20000 {
reg = <0 0x11f20000 0 0x1000>;
#address-cells = <1>;
#size-cells = <1>;
+
+ thermal_calibration: thermal-calib@274 {
+ reg = <0x274 0xc>;
+ };
};
clock-controller@15000000 {
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Add support for MT7981
2025-07-02 21:48 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add " Aleksander Jan Bajkowski
@ 2025-07-02 22:01 ` David Lechner
2025-07-03 7:48 ` Krzysztof Kozlowski
1 sibling, 0 replies; 7+ messages in thread
From: David Lechner @ 2025-07-02 22:01 UTC (permalink / raw)
To: Aleksander Jan Bajkowski, jic23, nuno.sa, andy, robh, krzk+dt,
conor+dt, matthias.bgg, angelogioacchino.delregno, zhiyong.tao,
linux-iio, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
On 7/2/25 4:48 PM, Aleksander Jan Bajkowski wrote:
> The temperature sensor in the MT7981 is same as in the MT7986.
> Add compatible string for mt7981.
>
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> .../devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
> index b489c984c1bb..ceb914dde15b 100644
> --- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
> @@ -26,6 +26,7 @@ properties:
> - mediatek,mt2712-auxadc
> - mediatek,mt6765-auxadc
> - mediatek,mt7622-auxadc
> + - mediatek,mt7981-auxadc
> - mediatek,mt7986-auxadc
> - mediatek,mt8173-auxadc
> - items:
The new compatible with fallback should look like this:
diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
index b489c984c1bb..14363389f30a 100644
--- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml
@@ -32,6 +32,10 @@ properties:
- enum:
- mediatek,mt7623-auxadc
- const: mediatek,mt2701-auxadc
+ - items:
+ - enum:
+ - mediatek,mt7981-auxadc
+ - const: mediatek,mt7986-auxadc
- items:
- enum:
- mediatek,mt6893-auxadc
---
Then you can validate that the next patch matches the bindings with
`make CHECK_DTBS=1`. I would expect it to fail currently since the
binding is specifying a compatible without a fallback but the .dts
uses a fallback.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] arm64: dts: mediatek: add thermal sensor support on mt7981
2025-07-02 21:48 ` [PATCH v2 2/2] arm64: dts: mediatek: add thermal sensor support on mt7981 Aleksander Jan Bajkowski
@ 2025-07-03 7:47 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-03 7:47 UTC (permalink / raw)
To: Aleksander Jan Bajkowski
Cc: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
matthias.bgg, angelogioacchino.delregno, zhiyong.tao, linux-iio,
devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
On Wed, Jul 02, 2025 at 11:48:30PM +0200, Aleksander Jan Bajkowski wrote:
> The temperature sensor in the MT7981 is same as in the MT7986.
>
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
> ---
> arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 32 ++++++++++++++++++++++-
> 1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
> index 5cbea9cd411f..759b9e8059d9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
> @@ -76,7 +76,7 @@ watchdog: watchdog@1001c000 {
> #reset-cells = <1>;
> };
>
> - clock-controller@1001e000 {
> + apmixedsys: clock-controller@1001e000 {
> compatible = "mediatek,mt7981-apmixedsys";
> reg = <0 0x1001e000 0 0x1000>;
> #clock-cells = <1>;
> @@ -184,6 +184,32 @@ spi@1100b000 {
> status = "disabled";
> };
>
> + thermal@1100c800 {
> + compatible = "mediatek,mt7981-thermal",
> + "mediatek,mt7986-thermal";
> + reg = <0 0x1100c800 0 0x800>;
> + interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&infracfg CLK_INFRA_THERM_CK>,
> + <&infracfg CLK_INFRA_ADC_26M_CK>;
> + clock-names = "therm", "auxadc";
> + nvmem-cells = <&thermal_calibration>;
> + nvmem-cell-names = "calibration-data";
> + #thermal-sensor-cells = <1>;
> + mediatek,auxadc = <&auxadc>;
> + mediatek,apmixedsys = <&apmixedsys>;
> + };
> +
> + auxadc: adc@1100d000 {
> + compatible = "mediatek,mt7981-auxadc",
> + "mediatek,mt7986-auxadc",
> + "mediatek,mt7622-auxadc";
That's not what your binding said.
It does not look like you tested the DTS against bindings. Please run
'make dtbs_check W=1' (see
Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).
Maybe you need to update your dtschema and yamllint. Don't rely on
distro packages for dtschema and be sure you are using the latest
released dtschema.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Add support for MT7981
2025-07-02 21:48 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add " Aleksander Jan Bajkowski
2025-07-02 22:01 ` David Lechner
@ 2025-07-03 7:48 ` Krzysztof Kozlowski
1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-03 7:48 UTC (permalink / raw)
To: Aleksander Jan Bajkowski
Cc: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
matthias.bgg, angelogioacchino.delregno, zhiyong.tao, linux-iio,
devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
On Wed, Jul 02, 2025 at 11:48:29PM +0200, Aleksander Jan Bajkowski wrote:
> The temperature sensor in the MT7981 is same as in the MT7986.
This is not what your binding is saying. Binding is saying it is
completely different.
> Add compatible string for mt7981.
>
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Please drop and request a re-review.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] Add thermal sensors support for MT7981
2025-07-02 21:48 [PATCH v2 0/2] Add thermal sensors support for MT7981 Aleksander Jan Bajkowski
2025-07-02 21:48 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add " Aleksander Jan Bajkowski
2025-07-02 21:48 ` [PATCH v2 2/2] arm64: dts: mediatek: add thermal sensor support on mt7981 Aleksander Jan Bajkowski
@ 2025-07-03 13:41 ` Rob Herring (Arm)
2 siblings, 0 replies; 7+ messages in thread
From: Rob Herring (Arm) @ 2025-07-03 13:41 UTC (permalink / raw)
To: Aleksander Jan Bajkowski
Cc: linux-kernel, nuno.sa, conor+dt, zhiyong.tao, matthias.bgg,
linux-iio, linux-arm-kernel, devicetree, krzk+dt, andy,
angelogioacchino.delregno, linux-mediatek, dlechner, jic23
On Wed, 02 Jul 2025 23:48:28 +0200, Aleksander Jan Bajkowski wrote:
> This patch adds support for the temperature sensor in the MT7981 SoC.
> This sensor is exactly the same as the one in the MT7986.
>
> Changes in v2:
> - added fallback to an existing compatible string
> - removed second patch as obsolete
>
> Aleksander Jan Bajkowski (2):
> dt-bindings: iio: adc: Add support for MT7981
> arm64: dts: mediatek: add thermal sensor support on mt7981
>
> .../iio/adc/mediatek,mt2701-auxadc.yaml | 1 +
> arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 32 ++++++++++++++++++-
> 2 files changed, 32 insertions(+), 1 deletion(-)
>
> --
> 2.39.5
>
>
>
My bot found new DTB warnings on the .dts files added or changed in this
series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:
pip3 install dtschema --upgrade
This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/next-20250702 (exact match)
If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)
New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/mediatek/' for 20250702214830.255898-1-olek2@wp.pl:
arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dtb: thermal@1100c800 (mediatek,mt7981-thermal): compatible: ['mediatek,mt7981-thermal', 'mediatek,mt7986-thermal'] is too long
from schema $id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dtb: thermal@1100c800 (mediatek,mt7981-thermal): Unevaluated properties are not allowed ('compatible' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dtb: adc@1100d000 (mediatek,mt7981-auxadc): compatible: 'oneOf' conditional failed, one must be fixed:
['mediatek,mt7981-auxadc', 'mediatek,mt7986-auxadc', 'mediatek,mt7622-auxadc'] is too long
'mediatek,mt7981-auxadc' is not one of ['mediatek,mt7623-auxadc']
'mediatek,mt7981-auxadc' is not one of ['mediatek,mt6893-auxadc', 'mediatek,mt8183-auxadc', 'mediatek,mt8186-auxadc', 'mediatek,mt8188-auxadc', 'mediatek,mt8195-auxadc', 'mediatek,mt8516-auxadc']
'mediatek,mt2701-auxadc' was expected
'mediatek,mt8173-auxadc' was expected
from schema $id: http://devicetree.org/schemas/iio/adc/mediatek,mt2701-auxadc.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dtb: thermal@1100c800 (mediatek,mt7981-thermal): compatible: ['mediatek,mt7981-thermal', 'mediatek,mt7986-thermal'] is too long
from schema $id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dtb: thermal@1100c800 (mediatek,mt7981-thermal): Unevaluated properties are not allowed ('compatible' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dtb: adc@1100d000 (mediatek,mt7981-auxadc): compatible: 'oneOf' conditional failed, one must be fixed:
['mediatek,mt7981-auxadc', 'mediatek,mt7986-auxadc', 'mediatek,mt7622-auxadc'] is too long
'mediatek,mt7981-auxadc' is not one of ['mediatek,mt7623-auxadc']
'mediatek,mt7981-auxadc' is not one of ['mediatek,mt6893-auxadc', 'mediatek,mt8183-auxadc', 'mediatek,mt8186-auxadc', 'mediatek,mt8188-auxadc', 'mediatek,mt8195-auxadc', 'mediatek,mt8516-auxadc']
'mediatek,mt2701-auxadc' was expected
'mediatek,mt8173-auxadc' was expected
from schema $id: http://devicetree.org/schemas/iio/adc/mediatek,mt2701-auxadc.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dtb: thermal@1100c800 (mediatek,mt7981-thermal): compatible: ['mediatek,mt7981-thermal', 'mediatek,mt7986-thermal'] is too long
from schema $id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dtb: thermal@1100c800 (mediatek,mt7981-thermal): Unevaluated properties are not allowed ('compatible' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dtb: adc@1100d000 (mediatek,mt7981-auxadc): compatible: 'oneOf' conditional failed, one must be fixed:
['mediatek,mt7981-auxadc', 'mediatek,mt7986-auxadc', 'mediatek,mt7622-auxadc'] is too long
'mediatek,mt7981-auxadc' is not one of ['mediatek,mt7623-auxadc']
'mediatek,mt7981-auxadc' is not one of ['mediatek,mt6893-auxadc', 'mediatek,mt8183-auxadc', 'mediatek,mt8186-auxadc', 'mediatek,mt8188-auxadc', 'mediatek,mt8195-auxadc', 'mediatek,mt8516-auxadc']
'mediatek,mt2701-auxadc' was expected
'mediatek,mt8173-auxadc' was expected
from schema $id: http://devicetree.org/schemas/iio/adc/mediatek,mt2701-auxadc.yaml#
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-07-03 13:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 21:48 [PATCH v2 0/2] Add thermal sensors support for MT7981 Aleksander Jan Bajkowski
2025-07-02 21:48 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add " Aleksander Jan Bajkowski
2025-07-02 22:01 ` David Lechner
2025-07-03 7:48 ` Krzysztof Kozlowski
2025-07-02 21:48 ` [PATCH v2 2/2] arm64: dts: mediatek: add thermal sensor support on mt7981 Aleksander Jan Bajkowski
2025-07-03 7:47 ` Krzysztof Kozlowski
2025-07-03 13:41 ` [PATCH v2 0/2] Add thermal sensors support for MT7981 Rob Herring (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).