All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings:iio:dac:microchip,mcp4725: fix properties for mcp4726
@ 2020-12-16 10:13 Tomas Novotny
  2020-12-21 19:27 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Novotny @ 2020-12-16 10:13 UTC (permalink / raw)
  To: linux-iio, devicetree
  Cc: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Rob Herring, Tomas Novotny, Jonathan Cameron

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 <tomas@novotny.cz>
---
 .../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


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

end of thread, other threads:[~2020-12-29 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 10:13 [PATCH] dt-bindings:iio:dac:microchip,mcp4725: fix properties for mcp4726 Tomas Novotny
2020-12-21 19:27 ` Rob Herring
2020-12-29 17:46   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.