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