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