Skip to contentSkip to conversation

dt-bindings: hwmon: tmp102: move ti,tmp103 out of trivial-devices.yaml

PATCH Applied [email protected] 4 participants 6 messages Aug 26 – Aug 31

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: hwmon: tmp102: move ti,tmp103 out of trivial-devices.yaml

From: Frank Li <[email protected]>

Move ti,tmp103 binding from trivial-devices.yaml to ti,tmp102.yaml. Both devices are single temperature sensors and update "#thermal-sensor-cells" property to accept values 0 and 1 (passing no argument is equivalent to passing 0 as the first argument)

Fix below CHECK_DTBS warnings:
arch/arm/boot/dts/nxp/imx/imx6dl-plym2m.dtb: temperature-sensor@70 (ti,tmp103): '#thermal-sensor-cells' does not match any of the regexes: '^pinctrl-[0-9]+$'

---
 Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 5 +++--
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +3 -2
index 96b2e4969f78a..cd96b1d8a2d5e 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/hwmon/ti,tmp102.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: TMP102 temperature sensor
+title: TMP102/TMP103 temperature sensor
 
 maintainers:
   - Krzysztof Kozlowski <[email protected]>
@@ -13,6 +13,7 @@ properties:
   compatible:
     enum:
       - ti,tmp102
+      - ti,tmp103
 
   interrupts:
     maxItems: 1
@@ -25,7 +26,7 @@ properties:
       A descriptive name for this channel, like "ambient" or "psu".
 
   "#thermal-sensor-cells":
-    const: 1
+    enum: [0, 1]
 
   vcc-supply:
     description: Power supply for tmp102
Documentation/devicetree/bindings/trivial-devices.yaml +0 -2
index 05f88cf81d6c6..3cdf9e0d8322d 100644
@@ -506,8 +506,6 @@ properties:
           - ti,lm74
             # Temperature sensor with integrated fan control
           - ti,lm96000
-            # Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
-          - ti,tmp103
             # Thermometer with SPI interface
           - ti,tmp121
           - ti,tmp122
Signature · 1 line
2.43.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] The `#thermal-sensor-cells` property is defined with an `enum` instead of a `const` constraint…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The #thermal-sensor-cells property is defined with an enum instead of a const constraint, violating DT binding rules.
- [Medium] The ti,tmp103 compatible string is added to a schema that globally allows the interrupts property, despite the TMP103 hardware lacking an interrupt pin. --

commit 8ed50c8d65316077824330117ca798258a318903
Author: Frank Li <[email protected]>

dt-bindings: hwmon: tmp102: move ti,tmp103 out of trivial-devices.yaml

Move the ti,tmp103 binding from trivial-devices.yaml to ti,tmp102.yaml. Both devices are single temperature sensors. This commit also updates the "#thermal-sensor-cells" property to accept values 0 and 1.

Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml properties: · line 19

Quoted 11 lines
Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +1 -0
@@ -13,6 +13,7 @@ properties:
   compatible:
     enum:
       - ti,tmp102
+      - ti,tmp103
 
   interrupts:
     maxItems: 1

[Severity: Medium]
Does adding ti,tmp103 here without additional constraints allow device trees to incorrectly define an interrupts property for the TMP103?

The TMP103 hardware lacks an interrupt pin. Because the interrupts property is globally permitted in this schema, the schema validation might silently pass invalid configurations that declare interrupts for ti,tmp103 nodes.

Should there be an allOf: if: conditional block to explicitly restrict the interrupts property only to compatibles that actually support it?

[ ... ]

Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml properties: · line 29

Quoted 6 lines
Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +1 -1
@@ -25,7 +26,7 @@ properties:
       A descriptive name for this channel, like "ambient" or "psu".
 
   "#thermal-sensor-cells":
-    const: 1
+    enum: [0, 1]

[Severity: Medium]
Does changing this constraint to an enum bypass the device tree binding rules?

Subsystem guidelines indicate that cell-count properties need a strict const constraint matching the hardware. If the schema allows both 0 and 1 cells for all hardware configurations, it might fail to catch incorrect cell count assignments in device tree nodes during build-time validation.

Would it be better to enforce const: 0 or const: 1 for specific hardware variants using conditional blocks based on the compatible string?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On Wed, Aug 26, 2026 at 05:14:19PM -0400, [email protected] wrote:

From: Frank Li <[email protected]>

Move ti,tmp103 binding from trivial-devices.yaml to ti,tmp102.yaml. Both devices are single temperature sensors and update "#thermal-sensor-cells" property to accept values 0 and 1 (passing no argument is equivalent to passing 0 as the first argument)

Why updating the property? If there are single sensors, then what is the cell for?

Quoted 9 lines

Fix below CHECK_DTBS warnings:
arch/arm/boot/dts/nxp/imx/imx6dl-plym2m.dtb: temperature-sensor@70 (ti,tmp103): '#thermal-sensor-cells' does not match any of the regexes: '^pinctrl-[0-9]+$'

---
 Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 5 +++--
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)

Best regards,
Krzysztof

maintainer
#3 lore raw
Quoted 11 lines · Krzysztof Kozlowski
Quoted 6 lines · On Wed, Aug 26, 2026 at 05:14:19PM -0400, [email protected] wrote:

From: Frank Li <[email protected]>

Move ti,tmp103 binding from trivial-devices.yaml to ti,tmp102.yaml. Both devices are single temperature sensors and update "#thermal-sensor-cells" property to accept values 0 and 1 (passing no argument is equivalent to passing 0 as the first argument)

Why updating the property? If there are single sensors, then what is the cell for?

It registers as temperature sensor with the thermal subsystem. The documentation of #thermal-sensor-cells states that the property is mandatory and "... Will be 0 on sensor nodes with only a single sensor". I don't claim to understand how this is supposed to work, but the thermal subsystem code looking for it does seem to suggest that the property is mandatory, even if there is only a single sensor.

Thanks,
Guenter

Quoted 12 lines
Quoted 9 lines

Fix below CHECK_DTBS warnings:
arch/arm/boot/dts/nxp/imx/imx6dl-plym2m.dtb: temperature-sensor@70 (ti,tmp103): '#thermal-sensor-cells' does not match any of the regexes: '^pinctrl-[0-9]+$'

---
  Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 5 +++--
  Documentation/devicetree/bindings/trivial-devices.yaml | 2 --
  2 files changed, 3 insertions(+), 4 deletions(-)

Best regards,
Krzysztof

Reviewed-by on v1 1/1
#4 lore raw
In reply to [email protected]
Quoted 38 lines · On 26/08/2026 23:14, [email protected] wrote:

From: Frank Li <[email protected]>

Move ti,tmp103 binding from trivial-devices.yaml to ti,tmp102.yaml. Both devices are single temperature sensors and update "#thermal-sensor-cells" property to accept values 0 and 1 (passing no argument is equivalent to passing 0 as the first argument)

Fix below CHECK_DTBS warnings:
arch/arm/boot/dts/nxp/imx/imx6dl-plym2m.dtb: temperature-sensor@70 (ti,tmp103): '#thermal-sensor-cells' does not match any of the regexes: '^pinctrl-[0-9]+$'

---
 Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 5 +++--
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +2 -1
index 96b2e4969f78a..cd96b1d8a2d5e 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/hwmon/ti,tmp102.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: TMP102 temperature sensor
+title: TMP102/TMP103 temperature sensor
 
 maintainers:
   - Krzysztof Kozlowski <[email protected]>
@@ -13,6 +13,7 @@ properties:
   compatible:
     enum:
       - ti,tmp102
+      - ti,tmp103
 
   interrupts:
     maxItems: 1

Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml properties: · line 29

Quoted 5 lines
Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +1 -1
@@ -25,7 +26,7 @@ properties:
       A descriptive name for this channel, like "ambient" or "psu".
 
   "#thermal-sensor-cells":
-    const: 1
+    enum: [0, 1]

I missed that old value was '1' which was not really correct. Looks good.

Best regards,
Krzysztof

maintainer Applied
#5 lore raw
In reply to [email protected]
Quoted 7 lines · On Wed, Aug 26, 2026 at 05:14:19PM -0400, [email protected] wrote:

From: Frank Li <[email protected]>

Move ti,tmp103 binding from trivial-devices.yaml to ti,tmp102.yaml. Both devices are single temperature sensors and update "#thermal-sensor-cells" property to accept values 0 and 1 (passing no argument is equivalent to passing 0 as the first argument)

Quoted 5 lines

Fix below CHECK_DTBS warnings:
arch/arm/boot/dts/nxp/imx/imx6dl-plym2m.dtb: temperature-sensor@70 (ti,tmp103): '#thermal-sensor-cells' does not match any of the regexes: '^pinctrl-[0-9]+$'

Applied.

Thanks,
Guenter