diff mbox series

[05/15] dt-bindings: iio: dac: ad5446: Add missing binding document

Message ID 20210627163244.1090296-6-jic23@kernel.org
State New
Headers show
Series dt-bindings: iio: dac: Add most missing binding documents. | expand

Commit Message

Jonathan Cameron June 27, 2021, 4:32 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>


Binding is a little stricter than the Linux driver.

It requires vcc-supply to be present for devices that don't have
an internal reference, whereas the driver just prints a message and
carries on.  Given this means that it is impossible to establish
a scaling of the output channel, let us make it required in the binding
schema.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 .../bindings/iio/dac/adi,ad5446.yaml          | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)

-- 
2.32.0

Comments

Rob Herring July 1, 2021, 2:02 p.m. UTC | #1
On Sun, 27 Jun 2021 17:32:34 +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> 

> Binding is a little stricter than the Linux driver.

> 

> It requires vcc-supply to be present for devices that don't have

> an internal reference, whereas the driver just prints a message and

> carries on.  Given this means that it is impossible to establish

> a scaling of the output channel, let us make it required in the binding

> schema.

> 

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> Cc: Lars-Peter Clausen <lars@metafoo.de>

> ---

>  .../bindings/iio/dac/adi,ad5446.yaml          | 105 ++++++++++++++++++

>  1 file changed, 105 insertions(+)

> 


My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/ti,dac7512.example.dt.yaml: dac@0: 'vcc-supply' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1497723

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring July 1, 2021, 7:30 p.m. UTC | #2
On Thu, Jul 01, 2021 at 08:02:43AM -0600, Rob Herring wrote:
> On Sun, 27 Jun 2021 17:32:34 +0100, Jonathan Cameron wrote:

> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> > 

> > Binding is a little stricter than the Linux driver.

> > 

> > It requires vcc-supply to be present for devices that don't have

> > an internal reference, whereas the driver just prints a message and

> > carries on.  Given this means that it is impossible to establish

> > a scaling of the output channel, let us make it required in the binding

> > schema.

> > 

> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> > Cc: Lars-Peter Clausen <lars@metafoo.de>

> > ---

> >  .../bindings/iio/dac/adi,ad5446.yaml          | 105 ++++++++++++++++++

> >  1 file changed, 105 insertions(+)

> > 

> 

> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'

> on your patch (DT_CHECKER_FLAGS is new in v5.13):

> 

> yamllint warnings/errors:

> 

> dtschema/dtc warnings/errors:

> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/ti,dac7512.example.dt.yaml: dac@0: 'vcc-supply' is a required property

> 	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml


Humm, seems it's not missing?

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml
new file mode 100644
index 000000000000..e0a0def20c8c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml
@@ -0,0 +1,105 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5446.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Single channel DACs similar to the AD5446
+
+maintainers:
+  - Lars-Peter Clausen <lars@metafoo.de>
+  - Jonathan Cameron <jic23@kernel.org>
+
+properties:
+  compatible:
+    oneOf:
+      - description: I2C devices
+        enum:
+          - adi,ad5602
+          - adi,ad5612
+          - adi,ad5622
+      - description: SPI devices
+        enum:
+          - adi,ad5300
+          - adi,ad5310
+          - adi,ad5320
+          - adi,ad5444
+          - adi,ad5446
+          - adi,ad5450
+          - adi,ad5451
+          - adi,ad5452
+          - adi,ad5453
+          - adi,ad5512a
+          - adi,ad5541a
+          - adi,ad5542a
+          - adi,ad5543
+          - adi,ad5553
+          - adi,ad5600
+          - adi,ad5601
+          - adi,ad5611
+          - adi,ad5621
+          - adi,ad5641
+          - adi,ad5620-2500
+          - adi,ad5620-1250
+          - adi,ad5640-2500
+          - adi,ad5640-1250
+          - adi,ad5660-2500
+          - adi,ad5660-1250
+          - adi,ad5662
+          - ti,dac081s101
+          - ti,dac101s101
+          - ti,dac121s101
+          - ti,dac7512
+
+  reg:
+    maxItems: 1
+
+  vcc-supply: true
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+# Ensure the scaling can be established for devices with no internal reference.
+allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - adi,ad5620-2500
+                - adi,ad5620-1250
+                - adi,ad5640-2500
+                - adi,ad5640-1250
+                - adi,ad5660-2500
+                - adi,ad5660-1250
+    then:
+      required:
+        - vcc-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5620-2500";
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@42 {
+            reg = <0x42>;
+            compatible = "adi,ad5602";
+            vcc-supply = <&vcc_dac>;
+        };
+    };
+...