Skip to contentSkip to conversation

dt-bindings: hwmon: convert TI INA2xx bindings to dt-schema

PATCH Applied Krzysztof Kozlowski 3 participants 14 messages Nov 17, 2020 – Dec 8, 2020

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

PATCH 1/4 dt-bindings: hwmon: convert TI INA2xx bindings to dt-schema

Convert the TI INA2xx bindings to dt-schema.

---
 .../devicetree/bindings/hwmon/ina2xx.txt      | 24 --------
 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  | 55 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 56 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ina2xx.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
Documentation/devicetree/bindings/hwmon/ina2xx.txt deleted +0 -24
deleted file mode 100644
index 02af0d94e921..000000000000
@@ -1,24 +0,0 @@
-ina2xx properties
-
-Required properties:
-- compatible: Must be one of the following:
-	- "ti,ina209" for ina209
-	- "ti,ina219" for ina219
-	- "ti,ina220" for ina220
-	- "ti,ina226" for ina226
-	- "ti,ina230" for ina230
-	- "ti,ina231" for ina231
-- reg: I2C address
-
-Optional properties:
-
-- shunt-resistor
-	Shunt resistor value in micro-Ohm
-
-Example:
-
-ina220@44 {
-	compatible = "ti,ina220";
-	reg = <0x44>;
-	shunt-resistor = <1000>;
-};
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml new file +55 -0

55 lines not on this page · raw message

MAINTAINERS +1 -1
index 0818a5b03832..e9ba2e555679 100644
@@ -8669,7 +8669,7 @@ INA209 HARDWARE MONITOR DRIVER
 M:	Guenter Roeck <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/hwmon/ina2xx.txt
+F:	Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
 F:	Documentation/hwmon/ina209.rst
 F:	drivers/hwmon/ina209.c
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/4 dt-bindings: hwmon: convert AD AD741x bindings to dt-schema

Convert the Analog Devices AD741x bindings to dt-schema.

---
 .../devicetree/bindings/hwmon/ad741x.txt      | 15 -------
 .../devicetree/bindings/hwmon/adi,ad741x.yaml | 39 +++++++++++++++++++
 2 files changed, 39 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ad741x.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ad741x.yaml
Documentation/devicetree/bindings/hwmon/ad741x.txt deleted +0 -15
deleted file mode 100644
index 9102152c8410..000000000000
@@ -1,15 +0,0 @@
-* AD7416/AD7417/AD7418 Temperature Sensor Device Tree Bindings
-
-Required properties:
-- compatible: one of
-		"adi,ad7416"
-		"adi,ad7417"
-		"adi,ad7418"
-- reg: I2C address
-
-Example:
-
-hwmon@28 {
-	compatible = "adi,ad7418";
-	reg = <0x28>;
-};
Documentation/devicetree/bindings/hwmon/adi,ad741x.yaml new file +39 -0
new file mode 100644
index 000000000000..ce7f8ce9da0a
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,ad741x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD7416/AD7417/AD7418 temperature sensors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad7416
+      - adi,ad7417
+      - adi,ad7418
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temperature-sensor@28 {
+            compatible = "adi,ad7418";
+            reg = <0x28>;
+        };
+    };
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] dt-bindings: hwmon: convert AD AD741x bindings to dt-schema

Quoted 10 lines · Krzysztof Kozlowski

Convert the Analog Devices AD741x bindings to dt-schema.

---
 .../devicetree/bindings/hwmon/ad741x.txt      | 15 -------
 .../devicetree/bindings/hwmon/adi,ad741x.yaml | 39 +++++++++++++++++++
 2 files changed, 39 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ad741x.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ad741x.yaml
maintainer Applied
#3 lore raw

Re: [PATCH 2/4] dt-bindings: hwmon: convert AD AD741x bindings to dt-schema

In reply to Krzysztof Kozlowski
Quoted 4 lines · Krzysztof Kozlowski

Convert the Analog Devices AD741x bindings to dt-schema.

Applied.

Thanks,
Guenter

Quoted 73 lines
---
 .../devicetree/bindings/hwmon/ad741x.txt      | 15 -------
 .../devicetree/bindings/hwmon/adi,ad741x.yaml | 39 +++++++++++++++++++
 2 files changed, 39 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ad741x.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ad741x.yaml
Documentation/devicetree/bindings/hwmon/ad741x.txt deleted +0 -15
deleted file mode 100644
index 9102152c8410..000000000000
@@ -1,15 +0,0 @@
-* AD7416/AD7417/AD7418 Temperature Sensor Device Tree Bindings
-
-Required properties:
-- compatible: one of
-		"adi,ad7416"
-		"adi,ad7417"
-		"adi,ad7418"
-- reg: I2C address
-
-Example:
-
-hwmon@28 {
-	compatible = "adi,ad7418";
-	reg = <0x28>;
-};
Documentation/devicetree/bindings/hwmon/adi,ad741x.yaml new file +39 -0
new file mode 100644
index 000000000000..ce7f8ce9da0a
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,ad741x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD7416/AD7417/AD7418 temperature sensors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad7416
+      - adi,ad7417
+      - adi,ad7418
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temperature-sensor@28 {
+            compatible = "adi,ad7418";
+            reg = <0x28>;
+        };
+    };
#4 lore raw

PATCH 3/4 dt-bindings: hwmon: convert TI ADS7828 bindings to dt-schema

In reply to Krzysztof Kozlowski

Convert the TI ADS7828 bindings to dt-schema.

---
 .../devicetree/bindings/hwmon/ads7828.txt     | 25 --------
 .../devicetree/bindings/hwmon/ti,ads7828.yaml | 57 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  4 --
 3 files changed, 57 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ads7828.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,ads7828.yaml
Documentation/devicetree/bindings/hwmon/ads7828.txt deleted +0 -25
deleted file mode 100644
index fe0cc4ad7ea9..000000000000
@@ -1,25 +0,0 @@
-ads7828 properties
-
-Required properties:
-- compatible: Should be one of
-	       ti,ads7828
-	       ti,ads7830
-- reg: I2C address
-
-Optional properties:
-
-- ti,differential-input
-  Set to use the device in differential mode.
-- vref-supply
-  The external reference on the device is set to this regulators output. If it
-  does not exists the internal reference will be used and output by the ads78xx
-  on the "external vref" pin.
-
-  Example ADS7828 node:
-
-  ads7828: ads@48 {
-	   comatible = "ti,ads7828";
-	   reg = <0x48>;
-	   vref-supply = <&vref>;
-	   ti,differential-input;
-  };
Documentation/devicetree/bindings/hwmon/ti,ads7828.yaml new file +57 -0

57 lines not on this page · raw message

Documentation/devicetree/bindings/trivial-devices.yaml +0 -4
index ab623ba930d5..1b1fa0424539 100644
@@ -350,10 +350,6 @@ properties:
           - st,24c256
             # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
           - taos,tsl2550
-            # 8-Channels, 12-bit ADC
-          - ti,ads7828
-            # 8-Channels, 8-bit ADC
-          - ti,ads7830
             # Temperature Monitoring and Fan Control
           - ti,amc6821
             # Temperature sensor with 2-wire interface
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 3/4
#5 lore raw

Re: [PATCH 3/4] dt-bindings: hwmon: convert TI ADS7828 bindings to dt-schema

Quoted 11 lines · Krzysztof Kozlowski

Convert the TI ADS7828 bindings to dt-schema.

---
 .../devicetree/bindings/hwmon/ads7828.txt     | 25 --------
 .../devicetree/bindings/hwmon/ti,ads7828.yaml | 57 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  4 --
 3 files changed, 57 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ads7828.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,ads7828.yaml
maintainer Applied
#6 lore raw

Re: [PATCH 3/4] dt-bindings: hwmon: convert TI ADS7828 bindings to dt-schema

In reply to Krzysztof Kozlowski
Quoted 4 lines · Krzysztof Kozlowski

Convert the TI ADS7828 bindings to dt-schema.

Applied.

Thanks,
Guenter

Quoted 117 lines
---
 .../devicetree/bindings/hwmon/ads7828.txt     | 25 --------
 .../devicetree/bindings/hwmon/ti,ads7828.yaml | 57 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  4 --
 3 files changed, 57 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ads7828.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,ads7828.yaml
Documentation/devicetree/bindings/hwmon/ads7828.txt deleted +0 -25
deleted file mode 100644
index fe0cc4ad7ea9..000000000000
@@ -1,25 +0,0 @@
-ads7828 properties
-
-Required properties:
-- compatible: Should be one of
-	       ti,ads7828
-	       ti,ads7830
-- reg: I2C address
-
-Optional properties:
-
-- ti,differential-input
-  Set to use the device in differential mode.
-- vref-supply
-  The external reference on the device is set to this regulators output. If it
-  does not exists the internal reference will be used and output by the ads78xx
-  on the "external vref" pin.
-
-  Example ADS7828 node:
-
-  ads7828: ads@48 {
-	   comatible = "ti,ads7828";
-	   reg = <0x48>;
-	   vref-supply = <&vref>;
-	   ti,differential-input;
-  };
Documentation/devicetree/bindings/hwmon/ti,ads7828.yaml new file +57 -0
new file mode 100644
index 000000000000..33ee575bb09d
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/ti,ads7828.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments ADS7828/ADS7830 Analog to Digital Converter (ADC)
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The ADS7828 is 12-Bit, 8-Channel Sampling Analog to Digital Converter (ADC)
+  with an I2C interface.
+
+  Datasheets:
+    https://www.ti.com/product/ADS7828
+
+properties:
+  compatible:
+    enum:
+      - ti,ads7828
+      - ti,ads7830
+
+  reg:
+    maxItems: 1
+
+  ti,differential-input:
+    description:
+      Set to use the device in differential mode.
+    type: boolean
+
+  vref-supply:
+    description:
+      The regulator to use as an external reference. If it does not exists the
+      internal reference will be used.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@48 {
+            comatible = "ti,ads7828";
+            reg = <0x48>;
+            vref-supply = <&vref>;
+            ti,differential-input;
+        };
+    };
Documentation/devicetree/bindings/trivial-devices.yaml +0 -4
index ab623ba930d5..1b1fa0424539 100644
@@ -350,10 +350,6 @@ properties:
           - st,24c256
             # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
           - taos,tsl2550
-            # 8-Channels, 12-bit ADC
-          - ti,ads7828
-            # 8-Channels, 8-bit ADC
-          - ti,ads7830
             # Temperature Monitoring and Fan Control
           - ti,amc6821
             # Temperature sensor with 2-wire interface
#7 lore raw

PATCH 4/4 dt-bindings: hwmon: convert AD ADM1275 bindings to dt-schema

In reply to Krzysztof Kozlowski

Convert the Analog Devices ADM1275 bindings to dt-schema.

---
 .../bindings/hwmon/adi,adm1275.yaml           | 58 +++++++++++++++++++
 .../devicetree/bindings/hwmon/adm1275.txt     | 25 --------
 Documentation/hwmon/adm1275.rst               |  2 +-
 3 files changed, 59 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml
 delete mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +58 -0
new file mode 100644
index 000000000000..2cad28c499dc
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,adm1275.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADM1075/ADM127x/ADM129x digital power monitors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The ADM1293 and ADM1294 are high accuracy integrated digital power monitors
+  that offer digital current, voltage, and power monitoring using an on-chip,
+  12-bit analog-to-digital converter (ADC), communicated through a PMBus
+  compliant I2C interface.
+
+  Datasheets:
+    https://www.analog.com/en/products/adm1294.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adm1075
+      - adi,adm1272
+      - adi,adm1275
+      - adi,adm1276
+      - adi,adm1278
+      - adi,adm1293
+      - adi,adm1294
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      Shunt resistor value in micro-Ohm.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        power-sensor@10 {
+            compatible = "adi,adm1272";
+            reg = <0x10>;
+            shunt-resistor-micro-ohms = <500>;
+        };
+    };
Documentation/devicetree/bindings/hwmon/adm1275.txt deleted +0 -25
deleted file mode 100644
index 1ecd03f3da4d..000000000000
@@ -1,25 +0,0 @@
-adm1275 properties
-
-Required properties:
-- compatible: Must be one of the supported compatible strings:
-	- "adi,adm1075" for adm1075
-	- "adi,adm1272" for adm1272
-	- "adi,adm1275" for adm1275
-	- "adi,adm1276" for adm1276
-	- "adi,adm1278" for adm1278
-	- "adi,adm1293" for adm1293
-	- "adi,adm1294" for adm1294
-- reg: I2C address
-
-Optional properties:
-
-- shunt-resistor-micro-ohms
-	Shunt resistor value in micro-Ohm
-
-Example:
-
-adm1272@10 {
-	compatible = "adi,adm1272";
-	reg = <0x10>;
-	shunt-resistor-micro-ohms = <500>;
-};
Documentation/hwmon/adm1275.rst +1 -1
index ce6528f90e4a..804590eeabdc 100644
@@ -83,7 +83,7 @@ or current scaling. Reported voltages, currents, and power are raw measurements,
 and will typically have to be scaled.
 
 The shunt value in micro-ohms can be set via device tree at compile-time. Please
-refer to the Documentation/devicetree/bindings/hwmon/adm1275.txt for bindings
+refer to the Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml for bindings
 if the device tree is used.
 
 Platform data support
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 4/4
#8 lore raw

Re: [PATCH 4/4] dt-bindings: hwmon: convert AD ADM1275 bindings to dt-schema

Quoted 46 lines · Krzysztof Kozlowski

Convert the Analog Devices ADM1275 bindings to dt-schema.

---
 .../bindings/hwmon/adi,adm1275.yaml           | 58 +++++++++++++++++++
 .../devicetree/bindings/hwmon/adm1275.txt     | 25 --------
 Documentation/hwmon/adm1275.rst               |  2 +-
 3 files changed, 59 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml
 delete mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +29 -0
new file mode 100644
index 000000000000..2cad28c499dc
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,adm1275.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADM1075/ADM127x/ADM129x digital power monitors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The ADM1293 and ADM1294 are high accuracy integrated digital power monitors
+  that offer digital current, voltage, and power monitoring using an on-chip,
+  12-bit analog-to-digital converter (ADC), communicated through a PMBus
+  compliant I2C interface.
+
+  Datasheets:
+    https://www.analog.com/en/products/adm1294.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adm1075
+      - adi,adm1272
+      - adi,adm1275
+      - adi,adm1276
+      - adi,adm1278

Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml line 39

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +10 -0
+      - adi,adm1293
+      - adi,adm1294
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      Shunt resistor value in micro-Ohm.
+    $ref: /schemas/types.yaml#/definitions/uint32

Don't need a type if you have units. With that dropped,

maintainer
#9 lore raw

Re: [PATCH 4/4] dt-bindings: hwmon: convert AD ADM1275 bindings to dt-schema

Quoted 51 lines · Rob Herring
Quoted 50 lines · Krzysztof Kozlowski

Convert the Analog Devices ADM1275 bindings to dt-schema.

---
 .../bindings/hwmon/adi,adm1275.yaml           | 58 +++++++++++++++++++
 .../devicetree/bindings/hwmon/adm1275.txt     | 25 --------
 Documentation/hwmon/adm1275.rst               |  2 +-
 3 files changed, 59 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml
 delete mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +33 -0
new file mode 100644
index 000000000000..2cad28c499dc
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,adm1275.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADM1075/ADM127x/ADM129x digital power monitors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The ADM1293 and ADM1294 are high accuracy integrated digital power monitors
+  that offer digital current, voltage, and power monitoring using an on-chip,
+  12-bit analog-to-digital converter (ADC), communicated through a PMBus
+  compliant I2C interface.
+
+  Datasheets:
+    https://www.analog.com/en/products/adm1294.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adm1075
+      - adi,adm1272
+      - adi,adm1275
+      - adi,adm1276
+      - adi,adm1278
+      - adi,adm1293
+      - adi,adm1294
+
+  reg:
Quoted 9 lines

Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml line 39

Quoted 6 lines
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +6 -0
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      Shunt resistor value in micro-Ohm.
+    $ref: /schemas/types.yaml#/definitions/uint32

Don't need a type if you have units. With that dropped,

Sorry, I am not familiar with the terminology. Does that refer to the '$ref' line ?

Thanks,
Guenter

#10 lore raw

Re: [PATCH 4/4] dt-bindings: hwmon: convert AD ADM1275 bindings to dt-schema

Quoted 62 lines · Guenter Roeck
Quoted 51 lines · Rob Herring
Quoted 50 lines · Krzysztof Kozlowski

Convert the Analog Devices ADM1275 bindings to dt-schema.

---
 .../bindings/hwmon/adi,adm1275.yaml           | 58 +++++++++++++++++++
 .../devicetree/bindings/hwmon/adm1275.txt     | 25 --------
 Documentation/hwmon/adm1275.rst               |  2 +-
 3 files changed, 59 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml
 delete mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +33 -0
new file mode 100644
index 000000000000..2cad28c499dc
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,adm1275.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADM1075/ADM127x/ADM129x digital power monitors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The ADM1293 and ADM1294 are high accuracy integrated digital power monitors
+  that offer digital current, voltage, and power monitoring using an on-chip,
+  12-bit analog-to-digital converter (ADC), communicated through a PMBus
+  compliant I2C interface.
+
+  Datasheets:
+    https://www.analog.com/en/products/adm1294.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adm1075
+      - adi,adm1272
+      - adi,adm1275
+      - adi,adm1276
+      - adi,adm1278
+      - adi,adm1293
+      - adi,adm1294
+
+  reg:
Quoted 9 lines

Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml line 39

Quoted 6 lines
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +6 -0
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      Shunt resistor value in micro-Ohm.
+    $ref: /schemas/types.yaml#/definitions/uint32

Don't need a type if you have units. With that dropped,

Quoted 2 lines

Sorry, I am not familiar with the terminology. Does that refer to the '$ref' line ?

Yes, it's the $ref line which can be safely removed. The core dt-schema applies such $ref if the property name ends with '-micro-ohms'.

Best regards,
Krzysztof

maintainer
#11 lore raw

Re: [PATCH 4/4] dt-bindings: hwmon: convert AD ADM1275 bindings to dt-schema

Quoted 63 lines · Krzysztof Kozlowski
Quoted 62 lines · Guenter Roeck
Quoted 60 lines · Rob Herring
Quoted 46 lines · Krzysztof Kozlowski

Convert the Analog Devices ADM1275 bindings to dt-schema.

---
 .../bindings/hwmon/adi,adm1275.yaml           | 58 +++++++++++++++++++
 .../devicetree/bindings/hwmon/adm1275.txt     | 25 --------
 Documentation/hwmon/adm1275.rst               |  2 +-
 3 files changed, 59 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml
 delete mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +29 -0
new file mode 100644
index 000000000000..2cad28c499dc
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/adi,adm1275.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADM1075/ADM127x/ADM129x digital power monitors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The ADM1293 and ADM1294 are high accuracy integrated digital power monitors
+  that offer digital current, voltage, and power monitoring using an on-chip,
+  12-bit analog-to-digital converter (ADC), communicated through a PMBus
+  compliant I2C interface.
+
+  Datasheets:
+    https://www.analog.com/en/products/adm1294.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adm1075
+      - adi,adm1272
+      - adi,adm1275
+      - adi,adm1276
+      - adi,adm1278

Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml line 39

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml new file +10 -0
+      - adi,adm1293
+      - adi,adm1294
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      Shunt resistor value in micro-Ohm.
+    $ref: /schemas/types.yaml#/definitions/uint32

Don't need a type if you have units. With that dropped,

Quoted 6 lines
Quoted 2 lines

Sorry, I am not familiar with the terminology. Does that refer to the '$ref' line ?

Yes, it's the $ref line which can be safely removed. The core dt-schema applies such $ref if the property name ends with '-micro-ohms'.

Thanks a lot for the information. Ill apply the patch with this line removed.

Thanks,
Guenter

maintainer Reviewed-by on v1 1/4
#12 lore raw
In reply to Krzysztof Kozlowski
Quoted 11 lines · Krzysztof Kozlowski

Convert the TI INA2xx bindings to dt-schema.

---
 .../devicetree/bindings/hwmon/ina2xx.txt      | 24 --------
 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  | 55 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 56 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ina2xx.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
maintainer Applied
#13 lore raw
In reply to Krzysztof Kozlowski
Quoted 4 lines · Krzysztof Kozlowski

Convert the TI INA2xx bindings to dt-schema.

Applied.

Thanks,
Guenter

Quoted 112 lines
---
 .../devicetree/bindings/hwmon/ina2xx.txt      | 24 --------
 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  | 55 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 56 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ina2xx.txt
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
Documentation/devicetree/bindings/hwmon/ina2xx.txt deleted +0 -24
deleted file mode 100644
index 02af0d94e921..000000000000
@@ -1,24 +0,0 @@
-ina2xx properties
-
-Required properties:
-- compatible: Must be one of the following:
-	- "ti,ina209" for ina209
-	- "ti,ina219" for ina219
-	- "ti,ina220" for ina220
-	- "ti,ina226" for ina226
-	- "ti,ina230" for ina230
-	- "ti,ina231" for ina231
-- reg: I2C address
-
-Optional properties:
-
-- shunt-resistor
-	Shunt resistor value in micro-Ohm
-
-Example:
-
-ina220@44 {
-	compatible = "ti,ina220";
-	reg = <0x44>;
-	shunt-resistor = <1000>;
-};
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml new file +55 -0
new file mode 100644
index 000000000000..6f0443322a36
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/ti,ina2xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments INA209 family of power/voltage monitors
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+
+description: |
+  The INA209 is a high-side current shunt and power monitor with
+  an I2C interface.
+
+  Datasheets:
+    https://www.ti.com/product/INA209
+
+properties:
+  compatible:
+    enum:
+      - ti,ina209
+      - ti,ina219
+      - ti,ina220
+      - ti,ina226
+      - ti,ina230
+      - ti,ina231
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor:
+    description:
+      Shunt resistor value in micro-Ohm.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        power-sensor@44 {
+            compatible = "ti,ina220";
+            reg = <0x44>;
+            shunt-resistor = <1000>;
+        };
+    };
MAINTAINERS +1 -1
index 0818a5b03832..e9ba2e555679 100644
@@ -8669,7 +8669,7 @@ INA209 HARDWARE MONITOR DRIVER
 M:	Guenter Roeck <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/hwmon/ina2xx.txt
+F:	Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
 F:	Documentation/hwmon/ina209.rst
 F:	drivers/hwmon/ina209.c