Debian Codegraph @

Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml

raw
1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/mfd/sprd,sc2731.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Spreadtrum SC27xx PMIC
8
9 maintainers:
10 - Orson Zhai <[email protected]>
11 - Baolin Wang <[email protected]>
12 - Chunyan Zhang <[email protected]>
13
14 description: |
15 Spreadtrum PMICs belonging to the SC27xx series integrate all mobile handset
16 power management, audio codec, battery management and user interface support
17 functions in a single chip. They have 6 major functional blocks:
18 - DCDCs to support CPU, memory
19 - LDOs to support both internal and external requirements
20 - Battery management system, such as charger, fuel gauge
21 - Audio codec
22 - User interface functions, such as indicator, flash LED and so on
23 - IC level interface, such as power on/off control, RTC, typec and so on
24
25 properties:
26 $nodename:
27 pattern: '^pmic@[0-9a-f]+$'
28
29 compatible:
30 enum:
31 - sprd,sc2720
32 - sprd,sc2721
33 - sprd,sc2723
34 - sprd,sc2730
35 - sprd,sc2731
36
37 reg:
38 maxItems: 1
39
40 interrupts:
41 maxItems: 1
42
43 interrupt-controller: true
44 spi-max-frequency: true
45
46 '#address-cells':
47 const: 1
48
49 '#interrupt-cells':
50 const: 1
51
52 '#size-cells':
53 const: 0
54
55 regulators:
56 type: object
57 $ref: /schemas/regulator/sprd,sc2731-regulator.yaml#
58
59 patternProperties:
60 "^adc@[0-9a-f]+$":
61 type: object
62 $ref: /schemas/iio/adc/sprd,sc2720-adc.yaml#
63
64 "^charger@[0-9a-f]+$":
65 type: object
66 $ref: /schemas/power/supply/sc2731-charger.yaml#
67
68 "^efuse@[0-9a-f]+$":
69 type: object
70 $ref: /schemas/nvmem/sprd,sc2731-efuse.yaml#
71
72 "^fuel-gauge@[0-9a-f]+$":
73 type: object
74 $ref: /schemas/power/supply/sc27xx-fg.yaml#
75
76 "^gpio@[0-9a-f]+$":
77 type: object
78 $ref: /schemas/gpio/sprd,gpio-eic.yaml#
79
80 "^led-controller@[0-9a-f]+$":
81 type: object
82 $ref: /schemas/leds/sprd,sc2731-bltc.yaml#
83
84 "^rtc@[0-9a-f]+$":
85 type: object
86 $ref: /schemas/rtc/sprd,sc2731-rtc.yaml#
87
88 "^vibrator@[0-9a-f]+$":
89 type: object
90 $ref: /schemas/input/sprd,sc27xx-vibrator.yaml#
91
92 required:
93 - compatible
94 - reg
95 - interrupts
96 - interrupt-controller
97 - spi-max-frequency
98 - '#address-cells'
99 - '#interrupt-cells'
100 - '#size-cells'
101
102 additionalProperties: false
103
104 examples:
105 - |
106 #include <dt-bindings/gpio/gpio.h>
107 #include <dt-bindings/interrupt-controller/arm-gic.h>
108 #include <dt-bindings/interrupt-controller/irq.h>
109 #include <dt-bindings/leds/common.h>
110
111 spi {
112 #address-cells = <1>;
113 #size-cells = <0>;
114
115 sc2731_pmic: pmic@0 {
116 compatible = "sprd,sc2731";
117 reg = <0>;
118 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
119 interrupt-controller;
120 spi-max-frequency = <26000000>;
121 #address-cells = <1>;
122 #interrupt-cells = <1>;
123 #size-cells = <0>;
124
125 charger@0 {
126 compatible = "sprd,sc2731-charger";
127 reg = <0x0>;
128 phys = <&ssphy>;
129 monitored-battery = <&bat>;
130 };
131
132 led-controller@200 {
133 compatible = "sprd,sc2731-bltc";
134 reg = <0x200>;
135 #address-cells = <1>;
136 #size-cells = <0>;
137
138 led@0 {
139 reg = <0x0>;
140 color = <LED_COLOR_ID_RED>;
141 };
142
143 led@1 {
144 reg = <0x1>;
145 color = <LED_COLOR_ID_GREEN>;
146 };
147
148 led@2 {
149 reg = <0x2>;
150 color = <LED_COLOR_ID_BLUE>;
151 };
152 };
153
154 rtc@280 {
155 compatible = "sprd,sc2731-rtc";
156 reg = <0x280>;
157 interrupt-parent = <&sc2731_pmic>;
158 interrupts = <2>;
159 };
160
161 pmic_eic: gpio@300 {
162 compatible = "sprd,sc2731-eic";
163 reg = <0x300>;
164 interrupt-parent = <&sc2731_pmic>;
165 interrupts = <5>;
166 gpio-controller;
167 #gpio-cells = <2>;
168 interrupt-controller;
169 #interrupt-cells = <2>;
170 };
171
172 efuse@380 {
173 compatible = "sprd,sc2731-efuse";
174 reg = <0x380>;
175 hwlocks = <&hwlock 12>;
176 #address-cells = <1>;
177 #size-cells = <1>;
178
179 /* Data cells */
180 fgu_calib: calib@6 {
181 reg = <0x6 0x2>;
182 bits = <0 9>;
183 };
184
185 adc_big_scale: calib@24 {
186 reg = <0x24 0x2>;
187 };
188
189 adc_small_scale: calib@26 {
190 reg = <0x26 0x2>;
191 };
192 };
193
194 pmic_adc: adc@480 {
195 compatible = "sprd,sc2731-adc";
196 reg = <0x480>;
197 interrupt-parent = <&sc2731_pmic>;
198 interrupts = <0>;
199 #io-channel-cells = <1>;
200 hwlocks = <&hwlock 4>;
201 nvmem-cells = <&adc_big_scale>, <&adc_small_scale>;
202 nvmem-cell-names = "big_scale_calib", "small_scale_calib";
203 };
204
205 fuel-gauge@a00 {
206 compatible = "sprd,sc2731-fgu";
207 reg = <0xa00>;
208 battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
209 interrupt-parent = <&sc2731_pmic>;
210 interrupts = <4>;
211 io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
212 io-channel-names = "bat-temp", "charge-vol";
213 nvmem-cells = <&fgu_calib>;
214 nvmem-cell-names = "fgu_calib";
215 monitored-battery = <&bat>;
216 sprd,calib-resistance-micro-ohms = <21500>;
217 };
218
219 vibrator@ec8 {
220 compatible = "sprd,sc2731-vibrator";
221 reg = <0xec8>;
222 };
223
224 regulators {
225 compatible = "sprd,sc2731-regulator";
226
227 BUCK_CPU0 {
228 regulator-name = "vddarm0";
229 regulator-min-microvolt = <400000>;
230 regulator-max-microvolt = <1996875>;
231 regulator-ramp-delay = <25000>;
232 regulator-always-on;
233 };
234
235 LDO_CAMA0 {
236 regulator-name = "vddcama0";
237 regulator-min-microvolt = <1200000>;
238 regulator-max-microvolt = <3750000>;
239 regulator-enable-ramp-delay = <100>;
240 };
241 };
242 };
243 };
244 ...