Thread (3 messages) 3 messages, 3 authors, 2020-12-29
STALE1976d LANDED

[PATCH] dt-bindings:iio:dac:microchip,mcp4725: fix properties for mcp4726

From: Tomas Novotny <hidden>
Date: 2020-12-16 10:23:01
Also in: linux-iio
Subsystem: iio subsystem and drivers, open firmware and flattened device tree bindings, the rest · Maintainers: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Torvalds

The vdd-supply property is optional if vref-supply is provided for
mcp4726.

Also the microchip,vref-buffered makes sense only if vref-supply is
specified.

Spotted by Jonathan during conversion to yaml.

Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Tomas Novotny <redacted>
---
 .../bindings/iio/dac/microchip,mcp4725.yaml   | 31 +++++++++++++++----
 1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml
index 271998610ceb..079f302d1349 100644
--- a/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml
@@ -39,20 +39,39 @@ properties:
 
 allOf:
   - if:
-      not:
-        properties:
-          compatible:
-            contains:
-              const: microchip,mcp4726
+      properties:
+        compatible:
+          contains:
+            const: microchip,mcp4725
     then:
       properties:
         vref-supply: false
+      required:
+        - vdd-supply
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: microchip,mcp4726
+    then:
+      anyOf:
+        - required:
+          - vdd-supply
+        - required:
+          - vref-supply
+
+  - if:
+      not:
+        required:
+          - vref-supply
+    then:
+      properties:
         microchip,vref-buffered: false
 
 required:
   - compatible
   - reg
-  - vdd-supply
 
 additionalProperties: false
 
-- 
2.26.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help