Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 # Copyright 2019 Analog Devices Inc.
0003 %YAML 1.2
0004 ---
0005 $id: http://devicetree.org/schemas/iio/adc/adi,ad7124.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007 
0008 title: Analog Devices AD7124 ADC device driver
0009 
0010 maintainers:
0011   - Stefan Popa <stefan.popa@analog.com>
0012 
0013 description: |
0014   Bindings for the Analog Devices AD7124 ADC device. Datasheet can be
0015   found here:
0016     https://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-8.pdf
0017 
0018 properties:
0019   compatible:
0020     enum:
0021       - adi,ad7124-4
0022       - adi,ad7124-8
0023 
0024   reg:
0025     description: SPI chip select number for the device
0026     maxItems: 1
0027 
0028   clocks:
0029     maxItems: 1
0030     description: phandle to the master clock (mclk)
0031 
0032   clock-names:
0033     items:
0034       - const: mclk
0035 
0036   interrupts:
0037     description: IRQ line for the ADC
0038     maxItems: 1
0039 
0040   '#address-cells':
0041     const: 1
0042 
0043   '#size-cells':
0044     const: 0
0045 
0046   refin1-supply:
0047     description: refin1 supply can be used as reference for conversion.
0048 
0049   refin2-supply:
0050     description: refin2 supply can be used as reference for conversion.
0051 
0052   avdd-supply:
0053     description: avdd supply can be used as reference for conversion.
0054 
0055   spi-max-frequency: true
0056 
0057 required:
0058   - compatible
0059   - reg
0060   - clocks
0061   - clock-names
0062   - interrupts
0063 
0064 patternProperties:
0065   "^channel@([0-9]|1[0-5])$":
0066     $ref: "adc.yaml"
0067     type: object
0068     description: |
0069       Represents the external channels which are connected to the ADC.
0070 
0071     properties:
0072       reg:
0073         description: |
0074           The channel number. It can have up to 8 channels on ad7124-4
0075           and 16 channels on ad7124-8, numbered from 0 to 15.
0076         items:
0077           minimum: 0
0078           maximum: 15
0079 
0080       adi,reference-select:
0081         description: |
0082           Select the reference source to use when converting on
0083           the specific channel. Valid values are:
0084           0: REFIN1(+)/REFIN1(−).
0085           1: REFIN2(+)/REFIN2(−).
0086           3: AVDD
0087           If this field is left empty, internal reference is selected.
0088         $ref: /schemas/types.yaml#/definitions/uint32
0089         enum: [0, 1, 3]
0090 
0091       diff-channels: true
0092 
0093       bipolar: true
0094 
0095       adi,buffered-positive:
0096         description: Enable buffered mode for positive input.
0097         type: boolean
0098 
0099       adi,buffered-negative:
0100         description: Enable buffered mode for negative input.
0101         type: boolean
0102 
0103     required:
0104       - reg
0105       - diff-channels
0106 
0107     additionalProperties: false
0108 
0109 additionalProperties: false
0110 
0111 examples:
0112   - |
0113     spi {
0114       #address-cells = <1>;
0115       #size-cells = <0>;
0116 
0117       adc@0 {
0118         compatible = "adi,ad7124-4";
0119         reg = <0>;
0120         spi-max-frequency = <5000000>;
0121         interrupts = <25 2>;
0122         interrupt-parent = <&gpio>;
0123         refin1-supply = <&adc_vref>;
0124         clocks = <&ad7124_mclk>;
0125         clock-names = "mclk";
0126 
0127         #address-cells = <1>;
0128         #size-cells = <0>;
0129 
0130         channel@0 {
0131           reg = <0>;
0132           diff-channels = <0 1>;
0133           adi,reference-select = <0>;
0134           adi,buffered-positive;
0135         };
0136 
0137         channel@1 {
0138           reg = <1>;
0139           bipolar;
0140           diff-channels = <2 3>;
0141           adi,reference-select = <0>;
0142           adi,buffered-positive;
0143           adi,buffered-negative;
0144         };
0145 
0146         channel@2 {
0147           reg = <2>;
0148           diff-channels = <4 5>;
0149         };
0150 
0151         channel@3 {
0152           reg = <3>;
0153           diff-channels = <6 7>;
0154         };
0155       };
0156     };