GNU Linux-libre 6.8.9-gnu
[releases.git] / Documentation / devicetree / bindings / iio / adc / samsung,exynos-adc.yaml
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/iio/adc/samsung,exynos-adc.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Samsung Exynos Analog to Digital Converter (ADC)
8
9 maintainers:
10   - Krzysztof Kozlowski <krzk@kernel.org>
11
12 properties:
13   compatible:
14     oneOf:
15       - enum:
16           - samsung,exynos-adc-v1                 # Exynos5250
17           - samsung,exynos-adc-v2
18           - samsung,exynos3250-adc
19           - samsung,exynos4212-adc                # Exynos4212 and Exynos4412
20           - samsung,exynos7-adc
21           - samsung,s3c2410-adc
22           - samsung,s3c2416-adc
23           - samsung,s3c2440-adc
24           - samsung,s3c2443-adc
25           - samsung,s3c6410-adc
26           - samsung,s5pv210-adc
27       - items:
28           - enum:
29               - samsung,exynos5433-adc
30           - const: samsung,exynos7-adc
31
32   reg:
33     maxItems: 1
34
35   clocks:
36     description:
37       Phandle to ADC bus clock. For Exynos3250 additional clock is needed.
38     minItems: 1
39     maxItems: 2
40
41   clock-names:
42     description:
43       Must contain clock names (adc, sclk) matching phandles in clocks
44       property.
45     minItems: 1
46     maxItems: 2
47
48   interrupts:
49     description:
50       ADC interrupt followed by optional touchscreen interrupt.
51     minItems: 1
52     maxItems: 2
53
54   "#io-channel-cells":
55     const: 1
56
57   vdd-supply: true
58
59   samsung,syscon-phandle:
60     $ref: /schemas/types.yaml#/definitions/phandle
61     description:
62       Phandle to the PMU system controller node (to access the ADC_PHY
63       register on Exynos3250/4x12/5250/5420/5800).
64
65   has-touchscreen:
66     description:
67       If present, indicates that a touchscreen is connected and usable.
68     type: boolean
69
70 required:
71   - compatible
72   - reg
73   - clocks
74   - clock-names
75   - interrupts
76   - "#io-channel-cells"
77   - vdd-supply
78
79 additionalProperties:
80   type: object
81
82 allOf:
83   - if:
84       properties:
85         compatible:
86           contains:
87             enum:
88               - samsung,exynos-adc-v1
89               - samsung,exynos-adc-v2
90               - samsung,exynos3250-adc
91               - samsung,exynos4212-adc
92     then:
93       required:
94         - samsung,syscon-phandle
95
96   - if:
97       properties:
98         compatible:
99           contains:
100             enum:
101               - samsung,exynos3250-adc
102     then:
103       properties:
104         clocks:
105           minItems: 2
106           maxItems: 2
107         clock-names:
108           items:
109             - const: adc
110             - const: sclk
111     else:
112       properties:
113         clocks:
114           minItems: 1
115           maxItems: 1
116         clock-names:
117           items:
118             - const: adc
119
120   - if:
121       required:
122         - has-touchscreen
123     then:
124       properties:
125         interrupts:
126           minItems: 2
127           maxItems: 2
128
129 examples:
130   - |
131     adc: adc@12d10000 {
132         compatible = "samsung,exynos-adc-v1";
133         reg = <0x12d10000 0x100>;
134         interrupts = <0 106 0>;
135         #io-channel-cells = <1>;
136
137         clocks = <&clock 303>;
138         clock-names = "adc";
139
140         vdd-supply = <&buck5_reg>;
141         samsung,syscon-phandle = <&pmu_system_controller>;
142
143         /* NTC thermistor is a hwmon device */
144         thermistor {
145             compatible = "murata,ncp15wb473";
146             pullup-uv = <1800000>;
147             pullup-ohm = <47000>;
148             pulldown-ohm = <0>;
149             io-channels = <&adc 4>;
150         };
151     };
152
153   - |
154     #include <dt-bindings/clock/exynos3250.h>
155
156     adc@126c0000 {
157         compatible = "samsung,exynos3250-adc";
158         reg = <0x126c0000 0x100>;
159         interrupts = <0 137 0>;
160         #io-channel-cells = <1>;
161
162         clocks = <&cmu CLK_TSADC>,
163                  <&cmu CLK_SCLK_TSADC>;
164         clock-names = "adc", "sclk";
165
166         vdd-supply = <&buck5_reg>;
167         samsung,syscon-phandle = <&pmu_system_controller>;
168     };