Rename .yaml to a more generic airoha-thermal and Document support for
Airoha AN7583 thermal driver.
Airoha AN7583 follow the same logic of Airoha EN7581 to read the
temperature but lack all the support for the PTP_THERMAL used to monitor
and react when trip point are triggered.
Also the Airoha AN7583 lives entirely under the Chip SCU SoC register
space.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
...n7581-thermal.yaml => airoha-thermal.yaml} | 42 ++++++++++++++++---
1 file changed, 36 insertions(+), 6 deletions(-)
rename Documentation/devicetree/bindings/thermal/{airoha,en7581-thermal.yaml => airoha-thermal.yaml} (52%)
diff --git a/Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml b/Documentation/devicetree/bindings/thermal/airoha-thermal.yaml
similarity index 52%
rename from Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml
rename to Documentation/devicetree/bindings/thermal/airoha-thermal.yaml
index ca0242ef0378..42f93b095783 100644
--- a/Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/airoha-thermal.yaml
@@ -1,17 +1,19 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
-$id: http://devicetree.org/schemas/thermal/airoha,en7581-thermal.yaml#
+$id: http://devicetree.org/schemas/thermal/airoha-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Airoha EN7581 Thermal Sensor and Monitor
+title: Airoha Thermal Sensor and Monitor
maintainers:
- Christian Marangi <ansuelsmth@gmail.com>
properties:
compatible:
- const: airoha,en7581-thermal
+ enum:
+ - airoha,en7581-thermal
+ - airoha,an7583-thermal
reg:
maxItems: 1
@@ -28,9 +30,30 @@ properties:
required:
- compatible
- - reg
- - interrupts
- - airoha,chip-scu
+ - '#thermal-sensor-cells'
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: airoha,en7581-thermal
+ then:
+ required:
+ - reg
+ - interrupts
+ - airoha,chip-scu
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: airoha,an7583-thermal
+ then:
+ properties:
+ reg: false
+ interrupts: false
+ airoha,chip-scu: false
additionalProperties: false
@@ -46,3 +69,10 @@ examples:
#thermal-sensor-cells = <0>;
};
+
+ - |
+ thermal-sensor {
+ compatible = "airoha,an7583-thermal";
+
+ #thermal-sensor-cells = <0>;
+ };
--
2.48.1
On 23/05/2025 20:29, Christian Marangi wrote:
> Rename .yaml to a more generic airoha-thermal and Document support for
> Airoha AN7583 thermal driver.
>
> Airoha AN7583 follow the same logic of Airoha EN7581 to read the
> temperature but lack all the support for the PTP_THERMAL used to monitor
> and react when trip point are triggered.
>
> Also the Airoha AN7583 lives entirely under the Chip SCU SoC register
> space.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> ...n7581-thermal.yaml => airoha-thermal.yaml} | 42 ++++++++++++++++---
> 1 file changed, 36 insertions(+), 6 deletions(-)
> rename Documentation/devicetree/bindings/thermal/{airoha,en7581-thermal.yaml => airoha-thermal.yaml} (52%)
No. I do not see any reason to rename correct filename (how we expect)
to incorrect (wrong format, no vendor prefix, not matching compatible).
>
> diff --git a/Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml b/Documentation/devicetree/bindings/thermal/airoha-thermal.yaml
> similarity index 52%
> rename from Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml
> rename to Documentation/devicetree/bindings/thermal/airoha-thermal.yaml
> index ca0242ef0378..42f93b095783 100644
> --- a/Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml
> +++ b/Documentation/devicetree/bindings/thermal/airoha-thermal.yaml
> @@ -1,17 +1,19 @@
> # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> %YAML 1.2
> ---
> -$id: http://devicetree.org/schemas/thermal/airoha,en7581-thermal.yaml#
> +$id: http://devicetree.org/schemas/thermal/airoha-thermal.yaml#
> $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> -title: Airoha EN7581 Thermal Sensor and Monitor
> +title: Airoha Thermal Sensor and Monitor
>
> maintainers:
> - Christian Marangi <ansuelsmth@gmail.com>
>
> properties:
> compatible:
> - const: airoha,en7581-thermal
> + enum:
> + - airoha,en7581-thermal
> + - airoha,an7583-thermal
>
> reg:
> maxItems: 1
> @@ -28,9 +30,30 @@ properties:
>
> required:
> - compatible
> - - reg
> - - interrupts
> - - airoha,chip-scu
> + - '#thermal-sensor-cells'
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: airoha,en7581-thermal
> + then:
> + required:
> + - reg
> + - interrupts
> + - airoha,chip-scu
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: airoha,an7583-thermal
> + then:
> + properties:
> + reg: false
Don't stuff completely different devices into one binding. They are
completely different if they have completely different programming model.
Best regards,
Krzysztof
© 2016 - 2025 Red Hat, Inc.