Path: blob/master/Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml
26309 views
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)1# Copyright 2019 Analog Devices Inc.2%YAML 1.23---4$id: http://devicetree.org/schemas/iio/adc/adi,ad7124.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#67title: Analog Devices AD7124 ADC device driver89maintainers:10- Stefan Popa <stefan.popa@analog.com>1112description: |13Bindings for the Analog Devices AD7124 ADC device. Datasheet can be14found here:15https://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-8.pdf1617properties:18compatible:19enum:20- adi,ad7124-421- adi,ad7124-82223reg:24description: SPI chip select number for the device25maxItems: 12627clocks:28maxItems: 129description: phandle to the master clock (mclk)3031clock-names:32items:33- const: mclk3435interrupts:36description: IRQ line for the ADC37maxItems: 13839rdy-gpios:40description:41GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but42highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its43DOUT aka MISO role) and so usually triggers a spurious interrupt. The44distinction between such a spurious event and a real one can only be done45by reading such a GPIO. (There is a register telling the same46information, but accessing that one needs a SPI transfer which then47triggers another interrupt event.)48maxItems: 14950'#address-cells':51const: 15253'#size-cells':54const: 05556refin1-supply:57description: refin1 supply can be used as reference for conversion.5859refin2-supply:60description: refin2 supply can be used as reference for conversion.6162avdd-supply:63description: avdd supply can be used as reference for conversion.6465required:66- compatible67- reg68- clocks69- clock-names70- interrupts7172patternProperties:73"^channel@([0-9]|1[0-5])$":74$ref: adc.yaml75type: object76description: |77Represents the external channels which are connected to the ADC.7879properties:80reg:81description: |82The channel number. It can have up to 8 channels on ad7124-483and 16 channels on ad7124-8, numbered from 0 to 15.84items:85minimum: 086maximum: 158788adi,reference-select:89description: |90Select the reference source to use when converting on91the specific channel. Valid values are:920: REFIN1(+)/REFIN1(−).931: REFIN2(+)/REFIN2(−).943: AVDD95If this field is left empty, internal reference is selected.96$ref: /schemas/types.yaml#/definitions/uint3297enum: [0, 1, 3]9899diff-channels: true100101bipolar: true102103adi,buffered-positive:104description: Enable buffered mode for positive input.105type: boolean106107adi,buffered-negative:108description: Enable buffered mode for negative input.109type: boolean110111required:112- reg113- diff-channels114115additionalProperties: false116117allOf:118- $ref: /schemas/spi/spi-peripheral-props.yaml#119120unevaluatedProperties: false121122examples:123- |124#include <dt-bindings/gpio/gpio.h>125spi {126#address-cells = <1>;127#size-cells = <0>;128129adc@0 {130compatible = "adi,ad7124-4";131reg = <0>;132spi-max-frequency = <5000000>;133interrupts = <25 2>;134interrupt-parent = <&gpio>;135rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>;136refin1-supply = <&adc_vref>;137clocks = <&ad7124_mclk>;138clock-names = "mclk";139140#address-cells = <1>;141#size-cells = <0>;142143channel@0 {144reg = <0>;145diff-channels = <0 1>;146adi,reference-select = <0>;147adi,buffered-positive;148};149150channel@1 {151reg = <1>;152bipolar;153diff-channels = <2 3>;154adi,reference-select = <0>;155adi,buffered-positive;156adi,buffered-negative;157};158159channel@2 {160reg = <2>;161diff-channels = <4 5>;162};163164channel@3 {165reg = <3>;166diff-channels = <6 7>;167};168};169};170171172