|
| 1 | +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 | +# Copyright 2024 Analog Devices Inc. |
| 3 | +%YAML 1.2 |
| 4 | +--- |
| 5 | +$id: http://devicetree.org/schemas/iio/adc/adi,ad4052.yaml# |
| 6 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 7 | + |
| 8 | +title: Analog Devices AD4052 ADC family device driver |
| 9 | + |
| 10 | +maintainers: |
| 11 | + - Jorge Marques <jorge.marques@analog.com> |
| 12 | + |
| 13 | +description: | |
| 14 | + Analog Devices AD4052 Single Channel Precision SAR ADC family |
| 15 | +
|
| 16 | + https://www.analog.com/media/en/technical-documentation/data-sheets/ad4050.pdf |
| 17 | + https://www.analog.com/media/en/technical-documentation/data-sheets/ad4052.pdf |
| 18 | +
|
| 19 | +properties: |
| 20 | + |
| 21 | + compatible: |
| 22 | + enum: |
| 23 | + - adi,ad4050 |
| 24 | + - adi,ad4052 |
| 25 | + - adi,ad4056 |
| 26 | + - adi,ad4058 |
| 27 | + |
| 28 | + reg: |
| 29 | + maxItems: 1 |
| 30 | + |
| 31 | + clocks: |
| 32 | + description: |
| 33 | + Reference clock |
| 34 | + |
| 35 | + clock-names: |
| 36 | + const: ref_clk |
| 37 | + |
| 38 | + interrupts: |
| 39 | + description: IRQ line for the ADC GP0 |
| 40 | + maxItems: 1 |
| 41 | + |
| 42 | + dmas: |
| 43 | + maxItems: 1 |
| 44 | + |
| 45 | + dma-names: |
| 46 | + const: rx |
| 47 | + |
| 48 | + pwms: |
| 49 | + maxItems: 1 |
| 50 | + |
| 51 | + pwm-names: |
| 52 | + oneOf: |
| 53 | + - items: |
| 54 | + - const: cnv |
| 55 | + |
| 56 | + cnv-gpios: |
| 57 | + description: GPIO line for the ADC CNV |
| 58 | + maxItems: 1 |
| 59 | + |
| 60 | + spi-max-frequency: |
| 61 | + maximum: 25000000 |
| 62 | + |
| 63 | + vdd-supply: true |
| 64 | + vdd_1_8-supply: true |
| 65 | + vio-supply: true |
| 66 | + |
| 67 | + adi,functional-mode: |
| 68 | + description: |
| 69 | + The device supports functional modes, granuality depends on the device. |
| 70 | + |
| 71 | + 0 - Sample is 12 or 16 bit. |
| 72 | + 1 - Sample is 24 or 16-bit burst average of n-samples. |
| 73 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 74 | + enum: [0, 1] |
| 75 | + default: 0 |
| 76 | + |
| 77 | +required: |
| 78 | + - compatible |
| 79 | + - reg |
| 80 | + - clocks |
| 81 | + - clock-names |
| 82 | + - dmas |
| 83 | + - dma-names |
| 84 | + - pwms |
| 85 | + - pwm-names |
| 86 | + - interrupts |
| 87 | + |
| 88 | +allOf: |
| 89 | + - $ref: /schemas/spi/spi-peripheral-props.yaml# |
| 90 | + - if: |
| 91 | + properties: |
| 92 | + compatible: |
| 93 | + contains: |
| 94 | + enum: |
| 95 | + - adi,ad4050 |
| 96 | + - adi,ad4052 |
| 97 | + - adi,ad4056 |
| 98 | + - adi,ad4058 |
| 99 | + then: |
| 100 | + properties: |
| 101 | + adi,functional-mode: |
| 102 | + enum: [0, 1] |
| 103 | + |
| 104 | +unevaluatedProperties: false |
| 105 | + |
| 106 | +examples: |
| 107 | + - | |
| 108 | + #include <dt-bindings/gpio/gpio.h> |
| 109 | +
|
| 110 | + spi { |
| 111 | + #address-cells = <1>; |
| 112 | + #size-cells = <0>; |
| 113 | +
|
| 114 | + adc@0 { |
| 115 | + compatible = "adi,ad4052"; |
| 116 | + reg = <0>; |
| 117 | + spi-max-frequency = <25000000>; |
| 118 | +
|
| 119 | + clocks = <&clk0>; |
| 120 | + clock-names = "ref_clk"; |
| 121 | + dmas = <&dma 0>; |
| 122 | + dma-names = "rx"; |
| 123 | + pwm-names = "cnv"; |
| 124 | + pwms = <&adc_trigger 0 0>; |
| 125 | + cnv-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; |
| 126 | + interrupts = <0 2>; |
| 127 | + interrupt-parent = <&gpio>; |
| 128 | +
|
| 129 | + adi,functional-mode = <0>; |
| 130 | + }; |
| 131 | + }; |
| 132 | +... |
0 commit comments