xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/mfd/rk817.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1RK817 Power Management Integrated Circuit
2
3Required properties:
4- compatible: "rockchip,rk817"
5- reg: I2C slave address
6- interrupt-parent: The parent interrupt controller.
7- interrupts: the interrupt outputs of the controller.
8- #clock-cells: from common clock binding; shall be set to 1 (multiple clock
9  outputs). See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
10
11Optional properties:
12- clock-output-names: From common clock binding to override the
13  default output clock name
14- rockchip,system-power-controller: Telling whether or not this pmic is controlling
15  the system power.
16- vcc1-supply:  The input supply for DCDC_REG1
17- vcc2-supply:  The input supply for DCDC_REG2
18- vcc3-supply:  The input supply for DCDC_REG3
19- vcc4-supply:  The input supply for DCDC_REG4
20- vcc5-supply:  The input supply for LDO_REG1, LDO_REG2, LDO_REG3
21- vcc6-supply:  The input supply for LDO_REG4, LDO_REG5, LDO_REG6
22- vcc7-supply:  The input supply for LDO_REG7, LDO_REG8, LDO_REG9
23- vcc8-supply:  The input supply for BOOST
24- vcc9-supply:  The input supply for OTG_SWITCH
25
26Regulators: All the regulators of RK817 to be instantiated shall be
27listed in a child node named 'regulators'. Each regulator is represented
28by a child node of the 'regulators' node.
29
30	regulator-name {
31		/* standard regulator bindings here */
32	};
33
34Following regulators of the RK817 PMIC block are supported. Note that
35the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO
36number as described in RK808 datasheet.
37
38	- DCDC_REGn
39		- valid values for n are 1 to 4.
40	- LDO_REGn
41		- valid values for n are 1 to 9.
42
43There are three pins needed config, named "gpio_ts" "gpio_gt" "gpio_slp".
44    The gpio_gt and gpio_ts pins support the gpio function.
45    For using a gpio function, dtsi need the following info:
46		pinctrl-names = "default";
47		pinctrl-0 = <&rk817_ts_gpio1>, <&rk817_gt_gpio2>;
48		gpios = <&pinctrl_rk8xx 1 GPIO_ACTIVE_HIGH>,
49			<&pinctrl_rk8xx 2 GPIO_ACTIVE_HIGH>;
50    The gpio_slp pin is for controlling the pmic states, as below:
51	reset
52	power down
53	sleep
54
55Standard regulator bindings are used inside regulator subnodes. Check
56  Documentation/devicetree/bindings/regulator/regulator.txt
57for more details
58
59Example:
60	rk817: pmic@20 {
61		compatible = "rockchip,rk817";
62		reg = <0x20>;
63		interrupt-parent = <&gpio0>;
64		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
65		pinctrl-names = "default", "pmic-sleep",
66				"pmic-power-off", "pmic-reset";
67		pinctrl-0 = <&pmic_int>;
68		pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>;
69		pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>;
70		pinctrl-3 = <&soc_slppin_rst>, <&rk817_slppin_rst>;
71		rockchip,system-power-controller;
72		wakeup-source;
73		#clock-cells = <1>;
74		clock-output-names = "rk808-clkout1", "rk808-clkout2";
75
76		vcc1-supply = <&vccsys>;
77		vcc2-supply = <&vccsys>;
78		vcc3-supply = <&vccsys>;
79		vcc4-supply = <&vccsys>;
80		vcc5-supply = <&vccsys>;
81		vcc6-supply = <&vccsys>;
82		vcc7-supply = <&vcc_3v0>;
83		vcc8-supply = <&vccsys>;
84		vcc9-supply = <&dcdc_boost>;
85
86		pwrkey {
87			status = "okay";
88		};
89
90		pinctrl_rk8xx: pinctrl_rk8xx {
91			gpio-controller;
92			#gpio-cells = <2>;
93
94			rk817_ts_gpio1: rk817_ts_gpio1 {
95				pins = "gpio_ts";
96				function = "pin_fun1";
97				/* output-low; */
98				/* input-enable; */
99			};
100
101			rk817_gt_gpio2: rk817_gt_gpio2 {
102				pins = "gpio_gt";
103				function = "pin_fun1";
104			};
105
106			rk817_pin_ts: rk817_pin_ts {
107				pins = "gpio_ts";
108				function = "pin_fun0";
109			};
110
111			rk817_pin_gt: rk817_pin_gt {
112				pins = "gpio_gt";
113				function = "pin_fun0";
114			};
115
116			rk817_slppin_null: rk817_slppin_null {
117				pins = "gpio_slp";
118				function = "pin_fun0";
119			};
120
121			rk817_slppin_slp: rk817_slppin_slp {
122				pins = "gpio_slp";
123				function = "pin_fun1";
124			};
125
126			rk817_slppin_pwrdn: rk817_slppin_pwrdn {
127				pins = "gpio_slp";
128				function = "pin_fun2";
129			};
130
131			rk817_slppin_rst: rk817_slppin_rst {
132				pins = "gpio_slp";
133				function = "pin_fun3";
134			};
135		};
136
137		regulators {
138			vdd_logic: DCDC_REG1 {
139				regulator-always-on;
140				regulator-boot-on;
141				regulator-min-microvolt = <950000>;
142				regulator-max-microvolt = <1350000>;
143				regulator-ramp-delay = <6001>;
144				regulator-initial-mode = <0x1>;
145				regulator-name = "vdd_logic";
146				regulator-state-mem {
147					regulator-on-in-suspend;
148					regulator-suspend-microvolt = <950000>;
149				};
150			};
151
152			vdd_arm: DCDC_REG2 {
153				regulator-always-on;
154				regulator-boot-on;
155				regulator-min-microvolt = <950000>;
156				regulator-max-microvolt = <1350000>;
157				regulator-ramp-delay = <6001>;
158				regulator-initial-mode = <0x1>;
159				regulator-name = "vdd_arm";
160				regulator-state-mem {
161					regulator-off-in-suspend;
162					regulator-suspend-microvolt = <950000>;
163				};
164			};
165
166			vcc_ddr: DCDC_REG3 {
167				regulator-always-on;
168				regulator-boot-on;
169				regulator-initial-mode = <0x1>;
170				regulator-name = "vcc_ddr";
171				regulator-state-mem {
172					regulator-on-in-suspend;
173				};
174			};
175
176			vcc_3v0: DCDC_REG4 {
177				regulator-always-on;
178				regulator-boot-on;
179				regulator-min-microvolt = <3000000>;
180				regulator-max-microvolt = <3000000>;
181				regulator-initial-mode = <0x1>;
182				regulator-name = "vcc_3v0";
183				regulator-state-mem {
184					regulator-off-in-suspend;
185					regulator-suspend-microvolt = <3000000>;
186				};
187			};
188
189			vcc2v5_ddr: LDO_REG1 {
190				regulator-always-on;
191				regulator-boot-on;
192				regulator-min-microvolt = <2500000>;
193				regulator-max-microvolt = <2500000>;
194				regulator-name = "vcc2v5_ddr";
195				regulator-state-mem {
196					regulator-on-in-suspend;
197					regulator-suspend-microvolt = <2500000>;
198				};
199			};
200
201			vcc1v8_soc: LDO_REG2 {
202				regulator-always-on;
203				regulator-boot-on;
204				regulator-min-microvolt = <1800000>;
205				regulator-max-microvolt = <1800000>;
206
207				regulator-name = "vcc1v8_soc";
208				regulator-state-mem {
209					regulator-on-in-suspend;
210					regulator-suspend-microvolt = <1800000>;
211				};
212			};
213
214			vdd1v0_soc: LDO_REG3 {
215				regulator-always-on;
216				regulator-boot-on;
217				regulator-min-microvolt = <1000000>;
218				regulator-max-microvolt = <1000000>;
219
220				regulator-name = "vcc1v0_soc";
221				regulator-state-mem {
222					regulator-on-in-suspend;
223					regulator-suspend-microvolt = <1000000>;
224				};
225			};
226
227			vcc3v0_pmu: LDO_REG4 {
228				regulator-always-on;
229				regulator-boot-on;
230				regulator-min-microvolt = <3000000>;
231				regulator-max-microvolt = <3000000>;
232
233				regulator-name = "vcc3v0_pmu";
234				regulator-state-mem {
235					regulator-on-in-suspend;
236					regulator-suspend-microvolt = <3000000>;
237
238				};
239			};
240
241			vccio_sd: LDO_REG5 {
242				regulator-always-on;
243				regulator-boot-on;
244				regulator-min-microvolt = <3300000>;
245				regulator-max-microvolt = <3300000>;
246
247				regulator-name = "vccio_sd";
248				regulator-state-mem {
249					regulator-on-in-suspend;
250					regulator-suspend-microvolt = <3300000>;
251				};
252			};
253
254			vcc_sd: LDO_REG6 {
255				regulator-always-on;
256				regulator-boot-on;
257				regulator-min-microvolt = <3300000>;
258				regulator-max-microvolt = <3300000>;
259
260				regulator-name = "vcc_sd";
261				regulator-state-mem {
262					regulator-on-in-suspend;
263					regulator-suspend-microvolt = <3300000>;
264
265				};
266			};
267
268			vcc2v8_dvp: LDO_REG7 {
269				regulator-always-on;
270				regulator-boot-on;
271				regulator-min-microvolt = <2800000>;
272				regulator-max-microvolt = <2800000>;
273
274				regulator-name = "vcc2v8_dvp";
275				regulator-state-mem {
276					regulator-off-in-suspend;
277					regulator-suspend-microvolt = <2800000>;
278				};
279			};
280
281			vcc1v8_dvp: LDO_REG8 {
282				regulator-always-on;
283				regulator-boot-on;
284				regulator-min-microvolt = <1800000>;
285				regulator-max-microvolt = <1800000>;
286
287				regulator-name = "vcc1v8_dvp";
288				regulator-state-mem {
289					regulator-on-in-suspend;
290					regulator-suspend-microvolt = <1800000>;
291				};
292			};
293
294			vdd1v5_dvp: LDO_REG9 {
295				regulator-always-on;
296				regulator-boot-on;
297				regulator-min-microvolt = <1500000>;
298				regulator-max-microvolt = <1500000>;
299
300				regulator-name = "vdd1v5_dvp";
301				regulator-state-mem {
302					regulator-off-in-suspend;
303					regulator-suspend-microvolt = <1500000>;
304				};
305			};
306
307			dcdc_boost: BOOST {
308				regulator-always-on;
309				regulator-boot-on;
310				regulator-min-microvolt = <4700000>;
311				regulator-max-microvolt = <5400000>;
312				regulator-name = "boost";
313			};
314
315			otg_switch: OTG_SWITCH {
316				regulator-boot-on;
317				regulator-name = "otg_switch";
318			};
319		};
320
321		battery {
322			compatible = "rk817,battery";
323			ocv_table = <3500 3625 3685 3697 3718 3735 3748
324			3760 3774 3788 3802 3816 3834 3853
325			3877 3908 3946 3975 4018 4071 4106>;
326			design_capacity = <2500>;
327			design_qmax = <2750>;
328			bat_res = <100>;
329			sleep_enter_current = <300>;
330			sleep_exit_current = <300>;
331			sleep_filter_current = <100>;
332			power_off_thresd = <3500>;
333			zero_algorithm_vol = <3850>;
334			max_soc_offset = <60>;
335			monitor_sec = <5>;
336			sample_res = <10>;
337			virtual_power = <1>;
338		};
339
340		charger {
341			compatible = "rk817,charger";
342			min_input_voltage = <4500>;
343			max_input_current = <1500>;
344			max_chrg_current = <1300>;
345			max_chrg_voltage = <4200>;
346			chrg_term_mode = <1>;
347			chrg_finish_cur = <300>;
348			virtual_power = <0>;
349			dc_det_adc = <0>;
350			extcon = <&u2phy>;
351		};
352
353		rk817_codec: codec {
354			#sound-dai-cells = <0>;
355			compatible = "rockchip,rk817-codec";
356			clocks = <&cru SCLK_I2S1_OUT>;
357			clock-names = "mclk";
358			pinctrl-names = "default";
359			pinctrl-0 = <&i2s1_2ch_mclk>;
360			hp-volume = <20>;
361			spk-volume = <3>;
362			status = "okay";
363		};
364	}
365