Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 | %YAML 1.2 |
| 3 | --- |
| 4 | $id: http://devicetree.org/schemas/iio/adc/adi,ad7091r5.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 7 | title: Analog Devices AD7091R-2/-4/-5/-8 Multi-Channel 12-Bit ADCs |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 8 | |
| 9 | maintainers: |
| 10 | - Michael Hennerich <michael.hennerich@analog.com> |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 11 | - Marcelo Schmitt <marcelo.schmitt@analog.com> |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 12 | |
| 13 | description: | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 14 | Analog Devices AD7091R5 4-Channel 12-Bit ADC supporting I2C interface |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 15 | https://www.analog.com/media/en/technical-documentation/data-sheets/ad7091r-5.pdf |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 16 | Analog Devices AD7091R-2/AD7091R-4/AD7091R-8 2-/4-/8-Channel 12-Bit ADCs |
| 17 | supporting SPI interface |
| 18 | https://www.analog.com/media/en/technical-documentation/data-sheets/AD7091R-2_7091R-4_7091R-8.pdf |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 19 | |
| 20 | properties: |
| 21 | compatible: |
| 22 | enum: |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 23 | - adi,ad7091r2 |
| 24 | - adi,ad7091r4 |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 25 | - adi,ad7091r5 |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 26 | - adi,ad7091r8 |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 27 | |
| 28 | reg: |
| 29 | maxItems: 1 |
| 30 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 31 | vdd-supply: |
| 32 | description: |
| 33 | Provide VDD power to the sensor (VDD range is from 2.7V to 5.25V). |
| 34 | |
| 35 | vdrive-supply: |
| 36 | description: |
| 37 | Determines the voltage level at which the interface logic will operate. |
| 38 | The V_drive voltage range is from 1.8V to 5.25V and must not exceed VDD by |
| 39 | more than 0.3V. |
| 40 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 41 | vref-supply: |
| 42 | description: |
| 43 | Phandle to the vref power supply |
| 44 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 45 | convst-gpios: |
| 46 | description: |
| 47 | GPIO connected to the CONVST pin. |
| 48 | This logic input is used to initiate conversions on the analog |
| 49 | input channels. |
| 50 | maxItems: 1 |
| 51 | |
| 52 | reset-gpios: |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 53 | maxItems: 1 |
| 54 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 55 | interrupts: |
| 56 | description: |
| 57 | Interrupt for signaling when conversion results exceed the high limit for |
| 58 | ADC readings or fall below the low limit for them. Interrupt source must |
| 59 | be attached to ALERT/BUSY/GPO0 pin. |
| 60 | maxItems: 1 |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 61 | |
| 62 | required: |
| 63 | - compatible |
| 64 | - reg |
| 65 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 66 | allOf: |
| 67 | - $ref: /schemas/spi/spi-peripheral-props.yaml# |
| 68 | |
| 69 | # AD7091R-2 does not have ALERT/BUSY/GPO pin |
| 70 | - if: |
| 71 | properties: |
| 72 | compatible: |
| 73 | contains: |
| 74 | enum: |
| 75 | - adi,ad7091r2 |
| 76 | then: |
| 77 | properties: |
| 78 | interrupts: false |
| 79 | |
| 80 | - if: |
| 81 | properties: |
| 82 | compatible: |
| 83 | contains: |
| 84 | enum: |
| 85 | - adi,ad7091r2 |
| 86 | - adi,ad7091r4 |
| 87 | - adi,ad7091r8 |
| 88 | then: |
| 89 | required: |
| 90 | - convst-gpios |
| 91 | |
| 92 | unevaluatedProperties: false |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 93 | |
| 94 | examples: |
| 95 | - | |
| 96 | #include <dt-bindings/gpio/gpio.h> |
| 97 | #include <dt-bindings/interrupt-controller/irq.h> |
| 98 | i2c { |
| 99 | #address-cells = <1>; |
| 100 | #size-cells = <0>; |
| 101 | |
| 102 | adc@2f { |
| 103 | compatible = "adi,ad7091r5"; |
| 104 | reg = <0x2f>; |
| 105 | |
| 106 | interrupts = <25 IRQ_TYPE_EDGE_FALLING>; |
| 107 | interrupt-parent = <&gpio>; |
| 108 | }; |
| 109 | }; |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 110 | - | |
| 111 | #include <dt-bindings/gpio/gpio.h> |
| 112 | #include <dt-bindings/interrupt-controller/irq.h> |
| 113 | spi { |
| 114 | #address-cells = <1>; |
| 115 | #size-cells = <0>; |
| 116 | |
| 117 | adc@0 { |
| 118 | compatible = "adi,ad7091r8"; |
| 119 | reg = <0x0>; |
| 120 | spi-max-frequency = <1000000>; |
| 121 | vref-supply = <&adc_vref>; |
| 122 | convst-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; |
| 123 | reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>; |
| 124 | interrupts = <22 IRQ_TYPE_EDGE_FALLING>; |
| 125 | interrupt-parent = <&gpio>; |
| 126 | }; |
| 127 | }; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 128 | ... |