xref: /linux/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml (revision 80739fd00c7ea1315d362ce889bef499452913ef)
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
7title: Spreadtrum SC27xx PMIC
8
9maintainers:
10  - Orson Zhai <orsonzhai@gmail.com>
11  - Baolin Wang <baolin.wang7@gmail.com>
12  - Chunyan Zhang <zhang.lyra@gmail.com>
13
14description: |
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
25properties:
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
59patternProperties:
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    additionalProperties: true
71    properties:
72      compatible:
73        enum:
74          - sprd,sc2720-efuse
75          - sprd,sc2721-efuse
76          - sprd,sc2723-efuse
77          - sprd,sc2730-efuse
78          - sprd,sc2731-efuse
79
80  "^fuel-gauge@[0-9a-f]+$":
81    type: object
82    $ref: /schemas/power/supply/sc27xx-fg.yaml#
83
84  "^gpio@[0-9a-f]+$":
85    type: object
86    $ref: /schemas/gpio/sprd,gpio-eic.yaml#
87
88  "^led-controller@[0-9a-f]+$":
89    type: object
90    $ref: /schemas/leds/sprd,sc2731-bltc.yaml#
91
92  "^rtc@[0-9a-f]+$":
93    type: object
94    $ref: /schemas/rtc/sprd,sc2731-rtc.yaml#
95
96  "^vibrator@[0-9a-f]+$":
97    type: object
98    $ref: /schemas/input/sprd,sc27xx-vibrator.yaml#
99
100required:
101  - compatible
102  - reg
103  - interrupts
104  - interrupt-controller
105  - spi-max-frequency
106  - '#address-cells'
107  - '#interrupt-cells'
108  - '#size-cells'
109
110additionalProperties: false
111
112examples:
113  - |
114    #include <dt-bindings/gpio/gpio.h>
115    #include <dt-bindings/interrupt-controller/arm-gic.h>
116    #include <dt-bindings/interrupt-controller/irq.h>
117    #include <dt-bindings/leds/common.h>
118
119    spi {
120      #address-cells = <1>;
121      #size-cells = <0>;
122
123      sc2731_pmic: pmic@0 {
124        compatible = "sprd,sc2731";
125        reg = <0>;
126        interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
127        interrupt-controller;
128        spi-max-frequency = <26000000>;
129        #address-cells = <1>;
130        #interrupt-cells = <1>;
131        #size-cells = <0>;
132
133        charger@0 {
134          compatible = "sprd,sc2731-charger";
135          reg = <0x0>;
136          phys = <&ssphy>;
137          monitored-battery = <&bat>;
138        };
139
140        led-controller@200 {
141          compatible = "sprd,sc2731-bltc";
142          reg = <0x200>;
143          #address-cells = <1>;
144          #size-cells = <0>;
145
146          led@0 {
147            reg = <0x0>;
148            color = <LED_COLOR_ID_RED>;
149          };
150
151          led@1 {
152            reg = <0x1>;
153            color = <LED_COLOR_ID_GREEN>;
154          };
155
156          led@2 {
157            reg = <0x2>;
158            color = <LED_COLOR_ID_BLUE>;
159          };
160        };
161
162        rtc@280 {
163          compatible = "sprd,sc2731-rtc";
164          reg = <0x280>;
165          interrupt-parent = <&sc2731_pmic>;
166          interrupts = <2>;
167        };
168
169        pmic_eic: gpio@300 {
170          compatible = "sprd,sc2731-eic";
171          reg = <0x300>;
172          interrupt-parent = <&sc2731_pmic>;
173          interrupts = <5>;
174          gpio-controller;
175          #gpio-cells = <2>;
176          interrupt-controller;
177          #interrupt-cells = <2>;
178        };
179
180        efuse@380 {
181          compatible = "sprd,sc2731-efuse";
182          reg = <0x380>;
183          hwlocks = <&hwlock 12>;
184          #address-cells = <1>;
185          #size-cells = <1>;
186
187          /* Data cells */
188          fgu_calib: calib@6 {
189            reg = <0x6 0x2>;
190            bits = <0 9>;
191          };
192
193          adc_big_scale: calib@24 {
194            reg = <0x24 0x2>;
195          };
196
197          adc_small_scale: calib@26 {
198            reg = <0x26 0x2>;
199          };
200        };
201
202        adc@480 {
203          compatible = "sprd,sc2731-adc";
204          reg = <0x480>;
205          interrupt-parent = <&sc2731_pmic>;
206          interrupts = <0>;
207          #io-channel-cells = <1>;
208          hwlocks = <&hwlock 4>;
209          nvmem-cells = <&adc_big_scale>, <&adc_small_scale>;
210          nvmem-cell-names = "big_scale_calib", "small_scale_calib";
211        };
212
213        fuel-gauge@a00 {
214          compatible = "sprd,sc2731-fgu";
215          reg = <0xa00>;
216          battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
217          interrupt-parent = <&sc2731_pmic>;
218          interrupts = <4>;
219          io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
220          io-channel-names = "bat-temp", "charge-vol";
221          nvmem-cells = <&fgu_calib>;
222          nvmem-cell-names = "fgu_calib";
223          monitored-battery = <&bat>;
224          sprd,calib-resistance-micro-ohms = <21500>;
225        };
226
227        vibrator@ec8 {
228          compatible = "sprd,sc2731-vibrator";
229          reg = <0xec8>;
230        };
231
232        regulators {
233          compatible = "sprd,sc2731-regulator";
234
235          BUCK_CPU0 {
236            regulator-name = "vddarm0";
237            regulator-min-microvolt = <400000>;
238            regulator-max-microvolt = <1996875>;
239            regulator-ramp-delay = <25000>;
240            regulator-always-on;
241          };
242
243          LDO_CAMA0 {
244            regulator-name = "vddcama0";
245            regulator-min-microvolt = <1200000>;
246            regulator-max-microvolt = <3750000>;
247            regulator-enable-ramp-delay = <100>;
248          };
249        };
250      };
251    };
252...
253