devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: hwmon: adc128d818: convert to dtschema
@ 2024-03-18 20:12 Javier Carrasco
  2024-03-19  5:49 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Javier Carrasco @ 2024-03-18 20:12 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Javier Carrasco

Convert adc128d818 bindings to dtschema to support validation.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 .../devicetree/bindings/hwmon/adc128d818.txt       | 38 -------------
 .../devicetree/bindings/hwmon/ti,adc128d818.yaml   | 63 ++++++++++++++++++++++
 2 files changed, 63 insertions(+), 38 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/adc128d818.txt b/Documentation/devicetree/bindings/hwmon/adc128d818.txt
deleted file mode 100644
index d0ae46d7bac3..000000000000
--- a/Documentation/devicetree/bindings/hwmon/adc128d818.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-TI ADC128D818 ADC System Monitor With Temperature Sensor
---------------------------------------------------------
-
-Operation modes:
-
- - Mode 0:  7 single-ended voltage readings (IN0-IN6),
-            1 temperature reading (internal)
- - Mode 1:  8 single-ended voltage readings (IN0-IN7),
-            no temperature
- - Mode 2:  4 pseudo-differential voltage readings
-              (IN0-IN1, IN3-IN2, IN4-IN5, IN7-IN6),
-            1 temperature reading (internal)
- - Mode 3:  4 single-ended voltage readings (IN0-IN3),
-            2 pseudo-differential voltage readings
-              (IN4-IN5, IN7-IN6),
-            1 temperature reading (internal)
-
-If no operation mode is configured via device tree, the driver keeps the
-currently active chip operation mode (default is mode 0).
-
-
-Required node properties:
-
- - compatible:  must be set to "ti,adc128d818"
- - reg:         I2C address of the device
-
-Optional node properties:
-
- - ti,mode:     Operation mode (u8) (see above).
-
-
-Example (operation mode 2):
-
-	adc128d818@1d {
-		compatible = "ti,adc128d818";
-		reg = <0x1d>;
-		ti,mode = /bits/ 8 <2>;
-	};
diff --git a/Documentation/devicetree/bindings/hwmon/ti,adc128d818.yaml b/Documentation/devicetree/bindings/hwmon/ti,adc128d818.yaml
new file mode 100644
index 000000000000..b48a9841600e
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/ti,adc128d818.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/ti,adc128d818.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments ADC128D818 ADC System Monitor With Temperature Sensor
+
+maintainers:
+  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
+
+description: |
+  The ADC128D818 is a 12-Bit, 8-Channel Analog to Digital Converter (ADC)
+  with a temperature sensor and an I2C interface.
+
+  Datasheets:
+    https://www.ti.com/product/ADC128D818
+
+properties:
+  compatible:
+    const: ti,adc128d818
+
+  reg:
+    maxItems: 1
+
+  ti,mode:
+    $ref: /schemas/types.yaml#/definitions/uint8
+    description:
+      Operation mode.
+      Mode 0  - 7 single-ended voltage readings (IN0-IN6), 1 temperature
+      reading (internal).
+      Mode 1 - 8 single-ended voltage readings (IN0-IN7), no temperature.
+      Mode 2 - 4 pseudo-differential voltage readings
+      (IN0-IN1, IN3-IN2, IN4-IN5, IN7-IN6), 1 temperature reading (internal).
+      Mode 3 - 4 single-ended voltage readings (IN0-IN3), 2 pseudo-differential
+      voltage readings (IN4-IN5, IN7-IN6), 1 temperature reading (internal).
+    default: 0
+
+  vref-supply:
+    description:
+      The regulator to use as an external reference. If it does not exist, the
+      internal reference will be used.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@1d {
+            compatible = "ti,adc128d818";
+            reg = <0x1d>;
+            vref-supply = <&vref>;
+            ti,mode = /bits/ 8 <2>;
+        };
+    };

---
base-commit: bf3a69c6861ff4dc7892d895c87074af7bc1c400
change-id: 20240318-adc128d818_dtschema-02b78fc26f65

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: hwmon: adc128d818: convert to dtschema
  2024-03-18 20:12 [PATCH] dt-bindings: hwmon: adc128d818: convert to dtschema Javier Carrasco
@ 2024-03-19  5:49 ` Krzysztof Kozlowski
  2024-03-19  7:01   ` Javier Carrasco
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-19  5:49 UTC (permalink / raw)
  To: Javier Carrasco, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel

On 18/03/2024 21:12, Javier Carrasco wrote:
> Convert adc128d818 bindings to dtschema to support validation.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

Thank you for your patch. There is something to discuss/improve.


> +$id: http://devicetree.org/schemas/hwmon/ti,adc128d818.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments ADC128D818 ADC System Monitor With Temperature Sensor
> +
> +maintainers:
> +  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
> +
> +description: |
> +  The ADC128D818 is a 12-Bit, 8-Channel Analog to Digital Converter (ADC)
> +  with a temperature sensor and an I2C interface.
> +
> +  Datasheets:
> +    https://www.ti.com/product/ADC128D818
> +
> +properties:
> +  compatible:
> +    const: ti,adc128d818
> +
> +  reg:
> +    maxItems: 1
> +
> +  ti,mode:

You need | to preserve the formatting.

With this:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: hwmon: adc128d818: convert to dtschema
  2024-03-19  5:49 ` Krzysztof Kozlowski
@ 2024-03-19  7:01   ` Javier Carrasco
  2024-03-19  9:28     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Javier Carrasco @ 2024-03-19  7:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel

On 3/19/24 06:49, Krzysztof Kozlowski wrote:
> On 18/03/2024 21:12, Javier Carrasco wrote:
>> Convert adc128d818 bindings to dtschema to support validation.
>>
>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> 
> Thank you for your patch. There is something to discuss/improve.
> 
> 
>> +$id: http://devicetree.org/schemas/hwmon/ti,adc128d818.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Texas Instruments ADC128D818 ADC System Monitor With Temperature Sensor
>> +
>> +maintainers:
>> +  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
>> +
>> +description: |
>> +  The ADC128D818 is a 12-Bit, 8-Channel Analog to Digital Converter (ADC)
>> +  with a temperature sensor and an I2C interface.
>> +
>> +  Datasheets:
>> +    https://www.ti.com/product/ADC128D818
>> +
>> +properties:
>> +  compatible:
>> +    const: ti,adc128d818
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  ti,mode:
> 
> You need | to preserve the formatting.
> 

Thanks, I overlooked that. If I am not mistaken, 2 are still missing 
(ti,mode and vref-supply descriptions).

By the way, do you know why dtschema does not complain about that? If I 
place a '|' in a wrong place, it does complain, though.

> With this:
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Best regards,
> Krzysztof
> 

Best regards,
Javier Carrasco

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: hwmon: adc128d818: convert to dtschema
  2024-03-19  7:01   ` Javier Carrasco
@ 2024-03-19  9:28     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-19  9:28 UTC (permalink / raw)
  To: Javier Carrasco, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel

On 19/03/2024 08:01, Javier Carrasco wrote:
> On 3/19/24 06:49, Krzysztof Kozlowski wrote:
>> On 18/03/2024 21:12, Javier Carrasco wrote:
>>> Convert adc128d818 bindings to dtschema to support validation.
>>>
>>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>>
>> Thank you for your patch. There is something to discuss/improve.
>>
>>
>>> +$id: http://devicetree.org/schemas/hwmon/ti,adc128d818.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Texas Instruments ADC128D818 ADC System Monitor With Temperature Sensor
>>> +
>>> +maintainers:
>>> +  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
>>> +
>>> +description: |
>>> +  The ADC128D818 is a 12-Bit, 8-Channel Analog to Digital Converter (ADC)
>>> +  with a temperature sensor and an I2C interface.
>>> +
>>> +  Datasheets:
>>> +    https://www.ti.com/product/ADC128D818
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: ti,adc128d818
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  ti,mode:
>>
>> You need | to preserve the formatting.
>>
> 
> Thanks, I overlooked that. If I am not mistaken, 2 are still missing 
> (ti,mode and vref-supply descriptions).

No, although I commented in a bit wrong place. It should be in
description of ti,mode. Not in vref-supply.

> 
> By the way, do you know why dtschema does not complain about that? If I 
> place a '|' in a wrong place, it does complain, though.

This is formatting, there is no reason to complain. How would dtschema
understand that you want or not want formatting?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-19  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-18 20:12 [PATCH] dt-bindings: hwmon: adc128d818: convert to dtschema Javier Carrasco
2024-03-19  5:49 ` Krzysztof Kozlowski
2024-03-19  7:01   ` Javier Carrasco
2024-03-19  9:28     ` Krzysztof Kozlowski

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).