diff mbox series

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

Message ID 20201216101316.1403-1-tomas@novotny.cz (mailing list archive)
State New, archived
Headers show
Series dt-bindings:iio:dac:microchip,mcp4725: fix properties for mcp4726 | expand

Commit Message

Tomas Novotny Dec. 16, 2020, 10:13 a.m. UTC
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(-)

Comments

Rob Herring (Arm) Dec. 21, 2020, 7:27 p.m. UTC | #1
On Wed, 16 Dec 2020 11:13:16 +0100, Tomas Novotny wrote:
> 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(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Jonathan Cameron Dec. 29, 2020, 5:46 p.m. UTC | #2
On Mon, 21 Dec 2020 12:27:38 -0700
Rob Herring <robh@kernel.org> wrote:

> On Wed, 16 Dec 2020 11:13:16 +0100, Tomas Novotny wrote:
> > 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>
I'm taking this this slow way as we are just providing slightly more flexible
conditions rather than allowing anything we suspect anyone is already using.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to probably ignore it ;)

Thanks for tidying this up.

Jonathan

> > ---
> >  .../bindings/iio/dac/microchip,mcp4725.yaml   | 31 +++++++++++++++----
> >  1 file changed, 25 insertions(+), 6 deletions(-)
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
diff mbox series

Patch

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