158 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)2# Copyright 2019 Analog Devices Inc.3%YAML 1.24---5$id: http://devicetree.org/schemas/iio/adc/adi,ad7124.yaml#6$schema: http://devicetree.org/meta-schemas/core.yaml#7 8title: Analog Devices AD7124 ADC device driver9 10maintainers:11 - Stefan Popa <stefan.popa@analog.com>12 13description: |14 Bindings for the Analog Devices AD7124 ADC device. Datasheet can be15 found here:16 https://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-8.pdf17 18properties:19 compatible:20 enum:21 - adi,ad7124-422 - adi,ad7124-823 24 reg:25 description: SPI chip select number for the device26 maxItems: 127 28 clocks:29 maxItems: 130 description: phandle to the master clock (mclk)31 32 clock-names:33 items:34 - const: mclk35 36 interrupts:37 description: IRQ line for the ADC38 maxItems: 139 40 '#address-cells':41 const: 142 43 '#size-cells':44 const: 045 46 refin1-supply:47 description: refin1 supply can be used as reference for conversion.48 49 refin2-supply:50 description: refin2 supply can be used as reference for conversion.51 52 avdd-supply:53 description: avdd supply can be used as reference for conversion.54 55required:56 - compatible57 - reg58 - clocks59 - clock-names60 - interrupts61 62patternProperties:63 "^channel@([0-9]|1[0-5])$":64 $ref: adc.yaml65 type: object66 description: |67 Represents the external channels which are connected to the ADC.68 69 properties:70 reg:71 description: |72 The channel number. It can have up to 8 channels on ad7124-473 and 16 channels on ad7124-8, numbered from 0 to 15.74 items:75 minimum: 076 maximum: 1577 78 adi,reference-select:79 description: |80 Select the reference source to use when converting on81 the specific channel. Valid values are:82 0: REFIN1(+)/REFIN1(−).83 1: REFIN2(+)/REFIN2(−).84 3: AVDD85 If this field is left empty, internal reference is selected.86 $ref: /schemas/types.yaml#/definitions/uint3287 enum: [0, 1, 3]88 89 diff-channels: true90 91 bipolar: true92 93 adi,buffered-positive:94 description: Enable buffered mode for positive input.95 type: boolean96 97 adi,buffered-negative:98 description: Enable buffered mode for negative input.99 type: boolean100 101 required:102 - reg103 - diff-channels104 105 additionalProperties: false106 107allOf:108 - $ref: /schemas/spi/spi-peripheral-props.yaml#109 110unevaluatedProperties: false111 112examples:113 - |114 spi {115 #address-cells = <1>;116 #size-cells = <0>;117 118 adc@0 {119 compatible = "adi,ad7124-4";120 reg = <0>;121 spi-max-frequency = <5000000>;122 interrupts = <25 2>;123 interrupt-parent = <&gpio>;124 refin1-supply = <&adc_vref>;125 clocks = <&ad7124_mclk>;126 clock-names = "mclk";127 128 #address-cells = <1>;129 #size-cells = <0>;130 131 channel@0 {132 reg = <0>;133 diff-channels = <0 1>;134 adi,reference-select = <0>;135 adi,buffered-positive;136 };137 138 channel@1 {139 reg = <1>;140 bipolar;141 diff-channels = <2 3>;142 adi,reference-select = <0>;143 adi,buffered-positive;144 adi,buffered-negative;145 };146 147 channel@2 {148 reg = <2>;149 diff-channels = <4 5>;150 };151 152 channel@3 {153 reg = <3>;154 diff-channels = <6 7>;155 };156 };157 };158