xref: /linux/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml (revision 72820915817773e728b18c82545db040e56d17e7)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/adc/atmel,sama9260-adc.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: AT91 sama9260 and similar Analog to Digital Converter (ADC)
8
9maintainers:
10  - Alexandre Belloni <alexandre.belloni@bootlin.com>
11
12properties:
13  compatible:
14    enum:
15      - atmel,at91sam9260-adc
16      - atmel,at91sam9rl-adc
17      - atmel,at91sam9g45-adc
18      - atmel,at91sam9x5-adc
19      - atmel,at91sama5d3-adc
20
21  reg:
22    maxItems: 1
23
24  interrupts:
25    maxItems: 1
26
27  clocks:
28    minItems: 2
29    maxItems: 2
30
31  clock-names:
32    items:
33      - const: adc_clk
34      - const: adc_op_clk
35
36  atmel,adc-channels-used:
37    $ref: /schemas/types.yaml#/definitions/uint32
38    description: Bitmask of the channels muxed and enabled for this device
39
40  atmel,adc-startup-time:
41    $ref: /schemas/types.yaml#/definitions/uint32
42    description:
43      Startup Time of the ADC in microseconds as defined in the datasheet
44
45  atmel,adc-vref:
46    $ref: /schemas/types.yaml#/definitions/uint32
47    description: Reference voltage in millivolts for the conversions
48
49  atmel,adc-use-external-triggers:
50    $ref: /schemas/types.yaml#/definitions/flag
51    description: Enable the external triggers
52
53  atmel,adc-use-res:
54    $ref: /schemas/types.yaml#/definitions/string
55    description:
56      String corresponding to an identifier from atmel,adc-res-names property.
57      If not specified, the highest resolution will be used.
58    enum:
59      - "lowres"
60      - "highres"
61
62  atmel,adc-sleep-mode:
63    $ref: /schemas/types.yaml#/definitions/flag
64    description: Enable sleep mode when no conversion
65
66  atmel,adc-sample-hold-time:
67    $ref: /schemas/types.yaml#/definitions/uint32
68    description: Sample and Hold Time in microseconds
69
70  atmel,adc-ts-wires:
71    $ref: /schemas/types.yaml#/definitions/uint32
72    description: |
73      Number of touchscreen wires. Must be set to enable touchscreen.
74      NOTE: when adc touchscreen is enabled, the adc hardware trigger will be
75      disabled. Since touchscreen will occupy the trigger register.
76    enum:
77      - 4
78      - 5
79
80  atmel,adc-ts-pressure-threshold:
81    $ref: /schemas/types.yaml#/definitions/uint32
82    description:
83      Pressure threshold for touchscreen.
84
85  "#io-channel-cells":
86    const: 1
87
88additionalProperties: false
89
90required:
91  - compatible
92  - reg
93  - interrupts
94  - clocks
95  - clock-names
96  - atmel,adc-channels-used
97  - atmel,adc-startup-time
98  - atmel,adc-vref
99
100patternProperties:
101  "^(trigger)[0-9]$":
102    type: object
103    description: Child node to describe a trigger exposed to the user.
104    properties:
105      trigger-name:
106        $ref: /schemas/types.yaml#/definitions/string
107        description: Identifying name.
108
109      trigger-value:
110        $ref: /schemas/types.yaml#/definitions/uint32
111        description:
112          Value to put in the Trigger register to activate this trigger
113
114      trigger-external:
115        $ref: /schemas/types.yaml#/definitions/flag
116        description: This trigger is provided from an external pin.
117
118    additionalProperties: false
119    required:
120      - trigger-name
121      - trigger-value
122
123examples:
124  - |
125    #include <dt-bindings/dma/at91.h>
126    #include <dt-bindings/interrupt-controller/irq.h>
127    soc {
128        #address-cells = <1>;
129        #size-cells = <1>;
130
131        adc@fffb0000 {
132            compatible = "atmel,at91sam9260-adc";
133            reg = <0xfffb0000 0x100>;
134            interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
135            clocks = <&adc_clk>, <&adc_op_clk>;
136            clock-names = "adc_clk", "adc_op_clk";
137            atmel,adc-channels-used = <0xff>;
138            atmel,adc-startup-time = <40>;
139            atmel,adc-use-external-triggers;
140            atmel,adc-vref = <3300>;
141            atmel,adc-use-res = "lowres";
142
143            trigger0 {
144                trigger-name = "external-rising";
145                trigger-value = <0x1>;
146                trigger-external;
147            };
148
149            trigger1 {
150                trigger-name = "external-falling";
151                trigger-value = <0x2>;
152                trigger-external;
153            };
154
155            trigger2 {
156                trigger-name = "external-any";
157                trigger-value = <0x3>;
158                trigger-external;
159            };
160
161            trigger3 {
162                trigger-name = "continuous";
163                trigger-value = <0x6>;
164            };
165        };
166    };
167...
168