162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/iio/adc/adi,ad7780.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Analog Devices AD7170/AD7171/AD7780/AD7781 analog to digital converters
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Michael Hennerich <michael.hennerich@analog.com>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cidescription: |
1362306a36Sopenharmony_ci  The ad7780 is a sigma-delta analog to digital converter. This driver provides
1462306a36Sopenharmony_ci  reading voltage values and status bits from both the ad778x and ad717x series.
1562306a36Sopenharmony_ci  Its interface also allows writing on the FILTER and GAIN GPIO pins on the
1662306a36Sopenharmony_ci  ad778x.
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci  Specifications on the converters can be found at:
1962306a36Sopenharmony_ci    AD7170:
2062306a36Sopenharmony_ci      https://www.analog.com/media/en/technical-documentation/data-sheets/AD7170.pdf
2162306a36Sopenharmony_ci    AD7171:
2262306a36Sopenharmony_ci      https://www.analog.com/media/en/technical-documentation/data-sheets/AD7171.pdf
2362306a36Sopenharmony_ci    AD7780:
2462306a36Sopenharmony_ci      https://www.analog.com/media/en/technical-documentation/data-sheets/ad7780.pdf
2562306a36Sopenharmony_ci    AD7781:
2662306a36Sopenharmony_ci      https://www.analog.com/media/en/technical-documentation/data-sheets/AD7781.pdf
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciproperties:
2962306a36Sopenharmony_ci  compatible:
3062306a36Sopenharmony_ci    enum:
3162306a36Sopenharmony_ci      - adi,ad7170
3262306a36Sopenharmony_ci      - adi,ad7171
3362306a36Sopenharmony_ci      - adi,ad7780
3462306a36Sopenharmony_ci      - adi,ad7781
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci  reg:
3762306a36Sopenharmony_ci    maxItems: 1
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci  avdd-supply:
4062306a36Sopenharmony_ci    description:
4162306a36Sopenharmony_ci      The regulator supply for the ADC reference voltage.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci  powerdown-gpios:
4462306a36Sopenharmony_ci    description:
4562306a36Sopenharmony_ci      Must be the device tree identifier of the PDRST pin. If
4662306a36Sopenharmony_ci      specified, it will be asserted during driver probe. As the
4762306a36Sopenharmony_ci      line is active high, it should be marked GPIO_ACTIVE_HIGH.
4862306a36Sopenharmony_ci    maxItems: 1
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci  adi,gain-gpios:
5162306a36Sopenharmony_ci    description:
5262306a36Sopenharmony_ci      Must be the device tree identifier of the GAIN pin. Only for
5362306a36Sopenharmony_ci      the ad778x chips. If specified, it will be asserted during
5462306a36Sopenharmony_ci      driver probe. As the line is active low, it should be marked
5562306a36Sopenharmony_ci      GPIO_ACTIVE_LOW.
5662306a36Sopenharmony_ci    maxItems: 1
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci  adi,filter-gpios:
5962306a36Sopenharmony_ci    description:
6062306a36Sopenharmony_ci      Must be the device tree identifier of the FILTER pin. Only
6162306a36Sopenharmony_ci      for the ad778x chips. If specified, it will be asserted
6262306a36Sopenharmony_ci      during driver probe. As the line is active low, it should be
6362306a36Sopenharmony_ci      marked GPIO_ACTIVE_LOW.
6462306a36Sopenharmony_ci    maxItems: 1
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_cirequired:
6762306a36Sopenharmony_ci  - compatible
6862306a36Sopenharmony_ci  - reg
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ciadditionalProperties: false
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ciexamples:
7362306a36Sopenharmony_ci  - |
7462306a36Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
7562306a36Sopenharmony_ci    spi {
7662306a36Sopenharmony_ci        #address-cells = <1>;
7762306a36Sopenharmony_ci        #size-cells = <0>;
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci        adc@0 {
8062306a36Sopenharmony_ci            compatible = "adi,ad7780";
8162306a36Sopenharmony_ci            reg = <0>;
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci            avdd-supply      = <&vdd_supply>;
8462306a36Sopenharmony_ci            powerdown-gpios  = <&gpio0 12 GPIO_ACTIVE_HIGH>;
8562306a36Sopenharmony_ci            adi,gain-gpios   = <&gpio1  5 GPIO_ACTIVE_LOW>;
8662306a36Sopenharmony_ci            adi,filter-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
8762306a36Sopenharmony_ci        };
8862306a36Sopenharmony_ci    };
89