Path: blob/master/Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml
29539 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- Marcelo Schmitt <marcelo.schmitt@analog.com>11- Nuno Sá <nuno.sa@analog.com>1213description: |14Bindings for the Analog Devices AD7124 ADC device. Datasheet can be15found here:16https://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-8.pdf1718properties:19compatible:20enum:21- adi,ad7124-422- adi,ad7124-82324reg:25description: SPI chip select number for the device26maxItems: 12728clocks:29maxItems: 130description: Optional external clock connected to the CLK pin.3132clock-names:33deprecated: true34description:35MCLK is an internal counter in the ADC. Do not use this property.36items:37- const: mclk3839'#clock-cells':40description:41The CLK pin can be used as an output. When that is the case, include42this property.43const: 04445interrupts:46description: IRQ line for the ADC47maxItems: 14849rdy-gpios:50description:51GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but52highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its53DOUT aka MISO role) and so usually triggers a spurious interrupt. The54distinction between such a spurious event and a real one can only be done55by reading such a GPIO. (There is a register telling the same56information, but accessing that one needs a SPI transfer which then57triggers another interrupt event.)58maxItems: 15960'#address-cells':61const: 16263'#size-cells':64const: 06566refin1-supply:67description: refin1 supply can be used as reference for conversion.6869refin2-supply:70description: refin2 supply can be used as reference for conversion.7172avdd-supply:73description: avdd supply can be used as reference for conversion.7475required:76- compatible77- reg78- interrupts7980# Can't have both clock input and output at the same time.81not:82required:83- '#clock-cells'84- clocks8586patternProperties:87"^channel@([0-9]|1[0-5])$":88$ref: adc.yaml89type: object90description: |91Represents the external channels which are connected to the ADC.9293properties:94reg:95description: |96The channel number. It can have up to 8 channels on ad7124-497and 16 channels on ad7124-8, numbered from 0 to 15.98items:99minimum: 0100maximum: 15101102adi,reference-select:103description: |104Select the reference source to use when converting on105the specific channel. Valid values are:1060: REFIN1(+)/REFIN1(−).1071: REFIN2(+)/REFIN2(−).1083: AVDD109If this field is left empty, internal reference is selected.110$ref: /schemas/types.yaml#/definitions/uint32111enum: [0, 1, 3]112113diff-channels: true114115bipolar: true116117adi,buffered-positive:118description: Enable buffered mode for positive input.119type: boolean120121adi,buffered-negative:122description: Enable buffered mode for negative input.123type: boolean124125required:126- reg127- diff-channels128129additionalProperties: false130131allOf:132- $ref: /schemas/spi/spi-peripheral-props.yaml#133134unevaluatedProperties: false135136examples:137- |138#include <dt-bindings/gpio/gpio.h>139spi {140#address-cells = <1>;141#size-cells = <0>;142143adc@0 {144compatible = "adi,ad7124-4";145reg = <0>;146spi-max-frequency = <5000000>;147interrupts = <25 2>;148interrupt-parent = <&gpio>;149rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>;150refin1-supply = <&adc_vref>;151152#address-cells = <1>;153#size-cells = <0>;154155channel@0 {156reg = <0>;157diff-channels = <0 1>;158adi,reference-select = <0>;159adi,buffered-positive;160};161162channel@1 {163reg = <1>;164bipolar;165diff-channels = <2 3>;166adi,reference-select = <0>;167adi,buffered-positive;168adi,buffered-negative;169};170171channel@2 {172reg = <2>;173diff-channels = <4 5>;174};175176channel@3 {177reg = <3>;178diff-channels = <6 7>;179};180};181};182183184