Thread (39 messages) 39 messages, 6 authors, 2021-07-27
STALE1802d

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

From: Jonathan Cameron <jic23@kernel.org>
Date: 2021-06-27 16:30:47
Also in: linux-devicetree
Subsystem: ad5446 analog devices inc ad5446 dac driver, analog devices inc iio drivers, iio subsystem and drivers, open firmware and flattened device tree bindings, the rest · Maintainers: Michael Hennerich, Nuno Sá, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Torvalds

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(+)
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>;
+        };
+    };
+...
-- 
2.32.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help