Skip to content

Commit ed38d26

Browse files
TonyXie06rkhuangtao
authored andcommitted
pinctrl: support pinctrl driver for the RK817&RK809 PMIC
Change-Id: I9a24ee0d9266a000d582f8ffff8b0c872e3a0769 Signed-off-by: Tony Xie <[email protected]>
1 parent 1a69527 commit ed38d26

File tree

5 files changed

+653
-123
lines changed

5 files changed

+653
-123
lines changed

Documentation/devicetree/bindings/mfd/rk809.txt

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ number as described in RK808 datasheet.
4141
- valid values for n are 1 to 9.
4242
- SWITCH_REGn
4343
- valid values for n are 1 to 2.
44+
45+
The gpio_slp pin is for controlling the pmic states, as below:
46+
reset
47+
power down
48+
sleep
49+
4450
Standard regulator bindings are used inside regulator subnodes. Check
4551
Documentation/devicetree/bindings/regulator/regulator.txt
4652
for more details
@@ -51,12 +57,16 @@ Example:
5157
reg = <0x20>;
5258
interrupt-parent = <&gpio0>;
5359
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
54-
pinctrl-names = "default";
60+
pinctrl-names = "default", "pmic-sleep",
61+
"pmic-power-off", "pmic-reset";
5562
pinctrl-0 = <&pmic_int>;
63+
pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>;
64+
pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>;
65+
pinctrl-3 = <&soc_slppin_rst>, <&rk817_slppin_rst>;
5666
rockchip,system-power-controller;
5767
wakeup-source;
5868
#clock-cells = <1>;
59-
clock-output-names = "xin32k", "rk808-clkout2";
69+
clock-output-names = "rk808-clkout1", "rk808-clkout2";
6070

6171
vcc1-supply = <&vcc5v0_sys>;
6272
vcc2-supply = <&vcc5v0_sys>;
@@ -68,66 +78,69 @@ Example:
6878
vcc8-supply = <&vcc3v3_sys>;
6979
vcc9-supply = <&vcc5v0_sys>;
7080

71-
vcc5v0_sys: vccsys{
72-
compatible = "regulator-fixed";
73-
regulator-name = "vcc5v0_sys";
74-
regulator-always-on;
75-
regulator-boot-on;
76-
regulator-min-microvolt = <5000000>;
77-
regulator-max-microvolt = <5000000>;
81+
pwrkey {
82+
status = "okay";
7883
};
7984

80-
rk817_pin0_ts: rk817_pin0_ts {
81-
pins = "gpio0";
82-
function = "pin_fun0";
83-
};
85+
pinctrl_rk8xx: pinctrl_rk8xx {
86+
gpio-controller;
87+
#gpio-cells = <2>;
8488

85-
rk817_pin0_gpio: rk817_pin0_gpio {
86-
pins = "gpio0";
87-
function = "gpio";
88-
};
89+
rk817_slppin_null: rk817_slppin_null {
90+
pins = "gpio_slp";
91+
function = "pin_fun0";
92+
};
8993

90-
rk817_pin1_gt: rk817_pin1_gt {
91-
pins = "gpio1";
92-
function = "pin_fun0";
93-
};
94+
rk817_slppin_slp: rk817_slppin_slp {
95+
pins = "gpio_slp";
96+
function = "pin_fun1";
97+
};
98+
99+
rk817_slppin_pwrdn: rk817_slppin_pwrdn {
100+
pins = "gpio_slp";
101+
function = "pin_fun2";
102+
};
94103

95-
rk817_pin1_gpio: rk817_pin1_gpio {
96-
pins = "gpio1";
97-
function = "gpio";
104+
rk817_slppin_rst: rk817_slppin_rst {
105+
pins = "gpio_slp";
106+
function = "pin_fun3";
107+
};
98108
};
99109

100110
regulators {
101-
vdd_arm: DCDC_REG1 {
111+
vdd_logic: DCDC_REG1 {
102112
regulator-always-on;
103113
regulator-boot-on;
104114
regulator-min-microvolt = <950000>;
105115
regulator-max-microvolt = <1350000>;
106116
regulator-ramp-delay = <6001>;
107-
regulator-name = "vdd_arm";
117+
regulator-initial-mode = <0x1>;
118+
regulator-name = "vdd_logic";
108119
regulator-state-mem {
109120
regulator-on-in-suspend;
110-
regulator-suspend-microvolt = <700000>;
121+
regulator-suspend-microvolt = <950000>;
111122
};
112123
};
113124

114-
vdd_logic: DCDC_REG2 {
125+
vdd_arm: DCDC_REG2 {
115126
regulator-always-on;
116127
regulator-boot-on;
117128
regulator-min-microvolt = <950000>;
118129
regulator-max-microvolt = <1350000>;
119130
regulator-ramp-delay = <6001>;
120-
regulator-name = "vdd_logic";
131+
regulator-initial-mode = <0x1>;
132+
regulator-name = "vdd_arm";
121133
regulator-state-mem {
122134
regulator-off-in-suspend;
123-
regulator-suspend-microvolt = <800000>;
135+
regulator-suspend-microvolt = <950000>;
124136
};
125137
};
126138

127139
vcc_ddr: DCDC_REG3 {
128140
regulator-always-on;
129141
regulator-boot-on;
130142
regulator-name = "vcc_ddr";
143+
regulator-initial-mode = <0x1>;
131144
regulator-state-mem {
132145
regulator-on-in-suspend;
133146
};
@@ -138,6 +151,7 @@ Example:
138151
regulator-boot-on;
139152
regulator-min-microvolt = <3000000>;
140153
regulator-max-microvolt = <3000000>;
154+
regulator-initial-mode = <0x1>;
141155
regulator-name = "vcc_3v0";
142156
regulator-state-mem {
143157
regulator-off-in-suspend;
@@ -178,7 +192,7 @@ Example:
178192

179193
regulator-name = "vcc1v0_soc";
180194
regulator-state-mem {
181-
regulator-off-in-suspend;
195+
regulator-on-in-suspend;
182196
regulator-suspend-microvolt = <1000000>;
183197
};
184198
};
@@ -191,7 +205,7 @@ Example:
191205

192206
regulator-name = "vcc3v0_pmu";
193207
regulator-state-mem {
194-
regulator-off-in-suspend;
208+
regulator-on-in-suspend;
195209
regulator-suspend-microvolt = <3000000>;
196210

197211
};
@@ -276,7 +290,6 @@ Example:
276290
};
277291

278292
vcc3v3_lcd: SWITCH_REG1 {
279-
regulator-always-on;
280293
regulator-boot-on;
281294
regulator-name = "vcc3v3_lcd";
282295
};
@@ -287,7 +300,16 @@ Example:
287300
regulator-name = "vcc5v0_host";
288301
};
289302
};
290-
};
291-
292-
293303

304+
rk809_codec: codec {
305+
#sound-dai-cells = <0>;
306+
compatible = "rockchip,rk809-codec", "rockchip,rk817-codec";
307+
clocks = <&cru SCLK_I2S1_OUT>;
308+
clock-names = "mclk";
309+
pinctrl-names = "default";
310+
pinctrl-0 = <&i2s1_2ch_mclk>;
311+
hp-volume = <20>;
312+
spk-volume = <3>;
313+
status = "okay";
314+
};
315+
}

0 commit comments

Comments
 (0)