Skip to contentSkip to conversation

dt-bindings: iio: temperature: Add DT bindings for TMP006

PATCH In review Anup Sharma 3 participants 6 messages May 10, 2023 – May 13, 2023

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

PATCH 1/1 dt-bindings: iio: temperature: Add DT bindings for TMP006

Add devicetree binding document for TMP006, IR thermopile sensor.

---
 .../bindings/iio/temperature/ti,tmp006.yaml   | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +38 -0
new file mode 100644
index 000000000000..c6c5a4d10898
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/temperature/ti,tmp006.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TMP006 IR thermopile sensor
+
+maintainers:
+  - Peter Meerwald <[email protected]>
+
+description: |
+  TI TMP006 - Infrared Thermopile Sensor in Chip-Scale Package.
+  https://cdn.sparkfun.com/datasheets/Sensors/Temp/tmp006.pdf
+
+properties:
+  compatible:
+    const: ti,tmp006
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        tmp006@40 {
+            compatible = "ti,tmp006";
+            reg = <0x40>;
+        };
+    };
Signature · 1 line
2.34.1
#1 lore raw
Quoted 1 line · Anup Sharma

Add devicetree binding document for TMP006, IR thermopile sensor.

Why? Where is any user of this? DTS? Driver?

Subject: drop second/last, redundant "DT bindings for". The "dt-bindings" prefix is already stating that these are bindings.

Quoted 24 lines
---
 .../bindings/iio/temperature/ti,tmp006.yaml   | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +11 -0
new file mode 100644
index 000000000000..c6c5a4d10898
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/temperature/ti,tmp006.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TMP006 IR thermopile sensor
+
+maintainers:
+  - Peter Meerwald <[email protected]>
+

Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +10 -0
+description: |
+  TI TMP006 - Infrared Thermopile Sensor in Chip-Scale Package.
+  https://cdn.sparkfun.com/datasheets/Sensors/Temp/tmp006.pdf
+
+properties:
+  compatible:
+    const: ti,tmp006
+
+  reg:
+    maxItems: 1

Missing supply.

Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml line 34

Quoted 13 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +13 -0
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        tmp006@40 {

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

temperature-sensor?

Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml line 38

Quoted 4 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +4 -0
+            compatible = "ti,tmp006";
+            reg = <0x40>;
+        };
+    };

Best regards,
Krzysztof

#2 lore raw
Quoted 5 lines · Krzysztof Kozlowski
Quoted 1 line · Anup Sharma

Add devicetree binding document for TMP006, IR thermopile sensor.

Why? Where is any user of this? DTS? Driver?

The support for TMP006 is available at driver/iio/temperature

Quoted 3 lines

Subject: drop second/last, redundant "DT bindings for". The "dt-bindings" prefix is already stating that these are bindings.

Okay, will take care in v2.

Quoted 28 lines
Quoted 28 lines
---
 .../bindings/iio/temperature/ti,tmp006.yaml   | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +15 -0
new file mode 100644
index 000000000000..c6c5a4d10898
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/temperature/ti,tmp006.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TMP006 IR thermopile sensor
+
+maintainers:
+  - Peter Meerwald <[email protected]>
+
+description: |
+  TI TMP006 - Infrared Thermopile Sensor in Chip-Scale Package.
+  https://cdn.sparkfun.com/datasheets/Sensors/Temp/tmp006.pdf
+
Quoted 9 lines

Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml line 21

Quoted 6 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +6 -0
+properties:
+  compatible:
+    const: ti,tmp006
+
+  reg:
+    maxItems: 1

Missing supply.

Will add in v2.

Quoted 17 lines

Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml line 34

Quoted 13 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +13 -0
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        tmp006@40 {

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Quoted 2 lines

temperature-sensor?

Thanks, I have noticed that out of the 8 temperature sensor bindings, 5 are using 'temp-sensor' as the node name, 2 are using 'temperature-sensor', and 1 is non-generic. According to this docs generic names recommendation 'temperature-sensor' seems to be ideal node name. Should I also proceed updating all the temperature sensor's node names to a generic format?

Quoted 8 lines

Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml line 38

Quoted 4 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp006.yaml new file +4 -0
+            compatible = "ti,tmp006";
+            reg = <0x40>;
+        };
+    };

Best regards,
Krzysztof

#3 lore raw
Quoted 8 lines · Anup Sharma
Quoted 5 lines · Krzysztof Kozlowski
Quoted 1 line · Anup Sharma

Add devicetree binding document for TMP006, IR thermopile sensor.

Why? Where is any user of this? DTS? Driver?

The support for TMP006 is available at driver/iio/temperature

There is no such compatible in the kernel. If you add OF support, you should change the driver.

Best regards,
Krzysztof

maintainer
#4 lore raw
Quoted 5 lines · On Fri, 12 May 2023 08:28:29 +0200 Krzysztof Kozlowski…
Quoted 4 lines · Anup Sharma
Quoted 3 lines · Krzysztof Kozlowski
Quoted 1 line · Anup Sharma

Add devicetree binding document for TMP006, IR thermopile sensor.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Why? Where is any user of this? DTS? Driver?

The support for TMP006 is available at driver/iio/temperature

There is no such compatible in the kernel. If you add OF support, you should change the driver.

(Very) old driver, so it uses the fallback method that i2c provides to bind to the compatible with the vendor id dropped via i2c_device_id entry.

Having said that, I'd also prefer the addition of an explicit of_device_id table. As there is only one supported device in this driver should be trivial.

Thanks,

Jonathan

Quoted 5 lines

Best regards,
Krzysztof

#5 lore raw
Quoted 11 lines · Jonathan Cameron
Quoted 8 lines · On Fri, 12 May 2023 08:28:29 +0200 Krzysztof Kozlowski…
Quoted 7 lines · Anup Sharma
Quoted 5 lines · Krzysztof Kozlowski
Quoted 1 line · Anup Sharma

Add devicetree binding document for TMP006, IR thermopile sensor.

Why? Where is any user of this? DTS? Driver?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

The support for TMP006 is available at driver/iio/temperature

There is no such compatible in the kernel. If you add OF support, you should change the driver.

(Very) old driver, so it uses the fallback method that i2c provides to bind to the compatible with the vendor id dropped via i2c_device_id entry.

Yeah, I know it works... but is very confusing :)

Quoted 3 lines

Having said that, I'd also prefer the addition of an explicit of_device_id table. As there is only one supported device in this driver should be trivial.

Best regards,
Krzysztof