diff mbox series

[v2,4/4] dt-bindings: adc: ad7887: add binding doc for AD7887

Message ID 20201119100748.57689-4-alexandru.ardelean@analog.com
State Needs Review / ACK
Headers show
Series None | expand

Checks

Context Check Description
robh/dt-meta-schema success
robh/checkpatch warning total: 0 errors, 1 warnings, 70 lines checked

Commit Message

Alexandru Ardelean Nov. 19, 2020, 10:07 a.m. UTC
This change adds a simple device-tree binding for thhe Analog Devices
AD7887 ADC.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 .../bindings/iio/adc/adi,ad7887.yaml          | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml

Comments

Jonathan Cameron Nov. 21, 2020, 3:39 p.m. UTC | #1
On Thu, 19 Nov 2020 12:07:48 +0200
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> This change adds a simple device-tree binding for thhe Analog Devices
> AD7887 ADC.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

Hi Alexandru

Few things inline.

Jonathan

> ---
>  .../bindings/iio/adc/adi,ad7887.yaml          | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml
> new file mode 100644
> index 000000000000..9b30f4569b4e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,ad7887.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD7887 low power, 12-bit ADC
> +
> +maintainers:
> +  - Michael Hennerich <michael.hennerich@analog.com>
> +
> +description: |
> +  Analog Devices AD7887 low power, 12-bit analog-to-digital converter (ADC)
> +  that operates from a single 2.7 V to 5.25 V power supply.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad7887
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-cpha: true
> +
> +  spi-cpol: true
> +
> +  avcc-supply: true

On datasheet this seems to be vdd-supply
As driver doesn't currently use it I assume ti would be safe to make them
match?

> +
> +  spi-max-frequency: true
> +
> +  vref-supply:
> +    description:
> +      ADC reference voltage supply

Perhaps worth mentioning that not supplying this will result in a 2.5V internal
reference being used unless we are in dual-channel-mode in which case it
will be VDD.  (I originally started looking at datasheet when I wondered
if we could just use the absence of this regulator to configure to single / dual
channel mode - but we can't because of the 2.5V internal reference).

> +
> +  adi,dual-channel-mode:
> +    description:
> +      Configures dual-channel mode for the ADC. In dual-channel operation,
> +      the AIN1/VREF pin assumes its AIN1 function, providing a second analog
> +      input channel. In this case, he reference voltage for the part is provided
> +      via the VDD pin. As a result, the input voltage range on both the AIN0 and
> +      AIN1 inputs is 0 to VDD.
> +    type: boolean
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - spi-cpha
> +  - spi-cpol
> +
> +examples:
> +  - |
> +    spi0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        adc@0 {
> +                compatible = "adi,ad7887";
> +                reg = <0>;
> +                spi-max-frequency = <1000000>;
> +                spi-cpol;
> +                spi-cpha;
> +
> +                avcc-supply = <&adc_supply>;
> +                vref-supply = <&adc_vref>;
> +        };
> +    };
> +...
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml
new file mode 100644
index 000000000000..9b30f4569b4e
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7887.yaml
@@ -0,0 +1,70 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/adi,ad7887.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD7887 low power, 12-bit ADC
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+description: |
+  Analog Devices AD7887 low power, 12-bit analog-to-digital converter (ADC)
+  that operates from a single 2.7 V to 5.25 V power supply.
+
+properties:
+  compatible:
+    enum:
+      - adi,ad7887
+
+  reg:
+    maxItems: 1
+
+  spi-cpha: true
+
+  spi-cpol: true
+
+  avcc-supply: true
+
+  spi-max-frequency: true
+
+  vref-supply:
+    description:
+      ADC reference voltage supply
+
+  adi,dual-channel-mode:
+    description:
+      Configures dual-channel mode for the ADC. In dual-channel operation,
+      the AIN1/VREF pin assumes its AIN1 function, providing a second analog
+      input channel. In this case, he reference voltage for the part is provided
+      via the VDD pin. As a result, the input voltage range on both the AIN0 and
+      AIN1 inputs is 0 to VDD.
+    type: boolean
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - spi-cpha
+  - spi-cpol
+
+examples:
+  - |
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+                compatible = "adi,ad7887";
+                reg = <0>;
+                spi-max-frequency = <1000000>;
+                spi-cpol;
+                spi-cpha;
+
+                avcc-supply = <&adc_supply>;
+                vref-supply = <&adc_vref>;
+        };
+    };
+...