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
7title: Samsung Exynos Analog to Digital Converter (ADC)
8
9maintainers:
10  - Krzysztof Kozlowski <krzk@kernel.org>
11
12properties:
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  vdd-supply: true
53
54  samsung,syscon-phandle:
55    $ref: '/schemas/types.yaml#/definitions/phandle'
56    description:
57      Phandle to the PMU system controller node (to access the ADC_PHY
58      register on Exynos3250/4x12/5250/5420/5800).
59
60  has-touchscreen:
61    description:
62      If present, indicates that a touchscreen is connected and usable.
63    type: boolean
64
65required:
66  - compatible
67  - reg
68  - clocks
69  - clock-names
70  - interrupts
71  - "#io-channel-cells"
72  - vdd-supply
73
74allOf:
75  - if:
76      properties:
77        compatible:
78          contains:
79            enum:
80              - samsung,exynos-adc-v1
81              - samsung,exynos-adc-v2
82              - samsung,exynos3250-adc
83              - samsung,exynos4212-adc
84    then:
85      required:
86        - samsung,syscon-phandle
87
88  - if:
89      properties:
90        compatible:
91          contains:
92            enum:
93              - samsung,exynos3250-adc
94    then:
95      properties:
96        clocks:
97          minItems: 2
98          maxItems: 2
99        clock-names:
100          items:
101            - const: adc
102            - const: sclk
103    else:
104      properties:
105        clocks:
106          minItems: 1
107          maxItems: 1
108        clock-names:
109          items:
110            - const: adc
111
112  - if:
113      required:
114        - has-touchscreen
115    then:
116      properties:
117        interrupts:
118          minItems: 2
119          maxItems: 2
120
121examples:
122  - |
123    adc: adc@12d10000 {
124        compatible = "samsung,exynos-adc-v1";
125        reg = <0x12d10000 0x100>;
126        interrupts = <0 106 0>;
127        #io-channel-cells = <1>;
128        io-channel-ranges;
129
130        clocks = <&clock 303>;
131        clock-names = "adc";
132
133        vdd-supply = <&buck5_reg>;
134        samsung,syscon-phandle = <&pmu_system_controller>;
135
136        /* NTC thermistor is a hwmon device */
137        ncp15wb473 {
138            compatible = "murata,ncp15wb473";
139            pullup-uv = <1800000>;
140            pullup-ohm = <47000>;
141            pulldown-ohm = <0>;
142            io-channels = <&adc 4>;
143          };
144    };
145
146  - |
147    #include <dt-bindings/clock/exynos3250.h>
148
149    adc@126c0000 {
150        compatible = "samsung,exynos3250-adc";
151        reg = <0x126C0000 0x100>;
152        interrupts = <0 137 0>;
153        #io-channel-cells = <1>;
154        io-channel-ranges;
155
156        clocks = <&cmu CLK_TSADC>,
157                 <&cmu CLK_SCLK_TSADC>;
158        clock-names = "adc", "sclk";
159
160        vdd-supply = <&buck5_reg>;
161        samsung,syscon-phandle = <&pmu_system_controller>;
162    };
163