arm64: dts: rk3399-mid: rk818 enabled boost_otg fix ota vcc5v poweroff when susppend
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-excavator-sapphire.dtsi
1 /*
2  * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 #include "rk3399-sapphire.dtsi"
44
45 / {
46         compatible = "rockchip,rk3399-sapphire-excavator", "rockchip,rk3399";
47
48         rt5651-sound {
49                 compatible = "simple-audio-card";
50                 simple-audio-card,format = "i2s";
51                 simple-audio-card,name = "realtek,rt5651-codec";
52                 simple-audio-card,mclk-fs = <256>;
53                 simple-audio-card,widgets =
54                         "Microphone", "Mic Jack",
55                         "Headphone", "Headphone Jack";
56                 simple-audio-card,routing =
57                         "Mic Jack", "MICBIAS1",
58                         "IN1P", "Mic Jack",
59                         "Headphone Jack", "HPOL",
60                         "Headphone Jack", "HPOR";
61                 simple-audio-card,cpu {
62                         sound-dai = <&i2s0>;
63                 };
64                 simple-audio-card,codec {
65                         sound-dai = <&rt5651>;
66                 };
67         };
68
69         spdif-sound {
70                 status = "okay";
71                 compatible = "simple-audio-card";
72                 simple-audio-card,name = "ROCKCHIP,SPDIF";
73                 simple-audio-card,cpu {
74                         sound-dai = <&spdif>;
75                 };
76                 simple-audio-card,codec {
77                         sound-dai = <&spdif_out>;
78                 };
79         };
80
81         spdif_out: spdif-out {
82                 status = "okay";
83                 compatible = "linux,spdif-dit";
84                 #sound-dai-cells = <0>;
85         };
86
87         sdio_pwrseq: sdio-pwrseq {
88                 compatible = "mmc-pwrseq-simple";
89                 clocks = <&rk808 1>;
90                 clock-names = "ext_clock";
91                 pinctrl-names = "default";
92                 pinctrl-0 = <&wifi_enable_h>;
93
94                 /*
95                  * On the module itself this is one of these (depending
96                  * on the actual card populated):
97                  * - SDIO_RESET_L_WL_REG_ON
98                  * - PDN (power down when low)
99                  */
100                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
101         };
102
103         wireless-wlan {
104                 compatible = "wlan-platdata";
105                 rockchip,grf = <&grf>;
106                 wifi_chip_type = "ap6354";
107                 sdio_vref = <1800>;
108                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
109                 status = "okay";
110         };
111
112         wireless-bluetooth {
113                 compatible = "bluetooth-platdata";
114                 //wifi-bt-power-toggle;
115                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
116                 pinctrl-names = "default", "rts_gpio";
117                 pinctrl-0 = <&uart0_rts>;
118                 pinctrl-1 = <&uart0_gpios>;
119                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
120                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
121                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
122                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
123                 status = "okay";
124         };
125 };
126
127 &spdif {
128         status = "okay";
129         pinctrl-0 = <&spdif_bus>;
130         i2c-scl-rising-time-ns = <450>;
131         i2c-scl-falling-time-ns = <15>;
132         #sound-dai-cells = <0>;
133 };
134
135 &i2c1 {
136         status = "okay";
137         i2c-scl-rising-time-ns = <300>;
138         i2c-scl-falling-time-ns = <15>;
139
140         rt5651: rt5651@1a {
141                 #sound-dai-cells = <0>;
142                 compatible = "rockchip,rt5651";
143                 reg = <0x1a>;
144                 clocks = <&cru SCLK_I2S_8CH_OUT>;
145                 clock-names = "mclk";
146                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
147                 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
148         };
149 };
150
151 &i2c4 {
152         status = "okay";
153         i2c-scl-rising-time-ns = <600>;
154         i2c-scl-falling-time-ns = <20>;
155
156         mpu6500@68 {
157                 status = "okay";
158                 compatible = "invensense,mpu6500";
159                 reg = <0x68>;
160                 irq-gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>;
161                 mpu-int_config = <0x10>;
162                 mpu-level_shifter = <0>;
163                 mpu-orientation = <0 1 0 1 0 0 0 0 1>;
164                 orientation-x= <1>;
165                 orientation-y= <0>;
166                 orientation-z= <0>;
167                 mpu-debug = <1>;
168         };
169 };
170
171 &uart0 {
172         pinctrl-names = "default";
173         pinctrl-0 = <&uart0_xfer &uart0_cts>;
174         status = "okay";
175 };
176
177 &saradc {
178         status = "okay";
179 };
180
181 &rockchip_suspend {
182         status = "okay";
183         rockchip,sleep-debug-en = <1>;
184         rockchip,sleep-mode-config = <
185                 (0
186                 | RKPM_SLP_ARMPD
187                 | RKPM_SLP_PERILPPD
188                 | RKPM_SLP_DDR_RET
189                 | RKPM_SLP_PLLPD
190                 | RKPM_SLP_CENTER_PD
191                 | RKPM_SLP_AP_PWROFF
192                 )
193                 >;
194         rockchip,wakeup-config = <
195                 (0
196                 | RKPM_GPIO_WKUP_EN
197                 | RKPM_PWM_WKUP_EN
198                 )
199                 >;
200                 rockchip,pwm-regulator-config = <
201                 (0
202                 | PWM2_REGULATOR_EN
203                 )
204                 >;
205                 rockchip,power-ctrl =
206                 <&gpio1 17 GPIO_ACTIVE_HIGH>,
207                 <&gpio1 14 GPIO_ACTIVE_HIGH>;
208 };
209
210 &pinctrl {
211         sdio-pwrseq {
212                 wifi_enable_h: wifi-enable-h {
213                         rockchip,pins =
214                                 <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
215                 };
216         };
217
218         wireless-bluetooth {
219                 uart0_gpios: uart0-gpios {
220                         rockchip,pins =
221                                 <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
222                 };
223         };
224 };