Merge tag 'qcom-dts-for-4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3288-veyron-chromebook.dtsi
1 /*
2  * Google Veyron (and derivatives) board device tree source
3  * Chromebook specific parts
4  *
5  * Copyright 2015 Google, Inc
6  *
7  * This file is dual-licensed: you can use it either under the terms
8  * of the GPL or the X11 license, at your option. Note that this dual
9  * licensing only applies to this file, and not this project as a
10  * whole.
11  *
12  *  a) This file is free software; you can redistribute it and/or
13  *     modify it under the terms of the GNU General Public License as
14  *     published by the Free Software Foundation; either version 2 of the
15  *     License, or (at your option) any later version.
16  *
17  *     This file is distributed in the hope that it will be useful,
18  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *     GNU General Public License for more details.
21  *
22  *  Or, alternatively,
23  *
24  *  b) Permission is hereby granted, free of charge, to any person
25  *     obtaining a copy of this software and associated documentation
26  *     files (the "Software"), to deal in the Software without
27  *     restriction, including without limitation the rights to use,
28  *     copy, modify, merge, publish, distribute, sublicense, and/or
29  *     sell copies of the Software, and to permit persons to whom the
30  *     Software is furnished to do so, subject to the following
31  *     conditions:
32  *
33  *     The above copyright notice and this permission notice shall be
34  *     included in all copies or substantial portions of the Software.
35  *
36  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43  *     OTHER DEALINGS IN THE SOFTWARE.
44  */
45
46 #include <dt-bindings/clock/rockchip,rk808.h>
47 #include <dt-bindings/input/input.h>
48 #include "rk3288-veyron.dtsi"
49 #include "rk3288-veyron-analog-audio.dtsi"
50 #include "rk3288-veyron-sdmmc.dtsi"
51
52 / {
53         aliases {
54                 /* Assign 20 so we don't get confused w/ builtin ones */
55                 i2c20 = &i2c_tunnel;
56         };
57
58         backlight: backlight {
59                 compatible = "pwm-backlight";
60                 brightness-levels = <
61                           0   1   2   3   4   5   6   7
62                           8   9  10  11  12  13  14  15
63                          16  17  18  19  20  21  22  23
64                          24  25  26  27  28  29  30  31
65                          32  33  34  35  36  37  38  39
66                          40  41  42  43  44  45  46  47
67                          48  49  50  51  52  53  54  55
68                          56  57  58  59  60  61  62  63
69                          64  65  66  67  68  69  70  71
70                          72  73  74  75  76  77  78  79
71                          80  81  82  83  84  85  86  87
72                          88  89  90  91  92  93  94  95
73                          96  97  98  99 100 101 102 103
74                         104 105 106 107 108 109 110 111
75                         112 113 114 115 116 117 118 119
76                         120 121 122 123 124 125 126 127
77                         128 129 130 131 132 133 134 135
78                         136 137 138 139 140 141 142 143
79                         144 145 146 147 148 149 150 151
80                         152 153 154 155 156 157 158 159
81                         160 161 162 163 164 165 166 167
82                         168 169 170 171 172 173 174 175
83                         176 177 178 179 180 181 182 183
84                         184 185 186 187 188 189 190 191
85                         192 193 194 195 196 197 198 199
86                         200 201 202 203 204 205 206 207
87                         208 209 210 211 212 213 214 215
88                         216 217 218 219 220 221 222 223
89                         224 225 226 227 228 229 230 231
90                         232 233 234 235 236 237 238 239
91                         240 241 242 243 244 245 246 247
92                         248 249 250 251 252 253 254 255>;
93                 default-brightness-level = <128>;
94                 enable-gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
95                 pinctrl-names = "default";
96                 pinctrl-0 = <&bl_en>;
97                 pwms = <&pwm0 0 1000000 0>;
98                 post-pwm-on-delay-ms = <10>;
99                 pwm-off-delay-ms = <10>;
100         };
101
102         gpio-charger {
103                 compatible = "gpio-charger";
104                 charger-type = "mains";
105                 gpios = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
106                 pinctrl-names = "default";
107                 pinctrl-0 = <&ac_present_ap>;
108         };
109
110         panel: panel {
111                 compatible ="innolux,n116bge", "simple-panel";
112                 status = "okay";
113                 power-supply = <&vcc33_lcd>;
114                 backlight = <&backlight>;
115
116                 ports {
117                         panel_in: port {
118                                 panel_in_edp: endpoint {
119                                         remote-endpoint = <&edp_out_panel>;
120                                 };
121                         };
122                 };
123         };
124
125         /* A non-regulated voltage from power supply or battery */
126         vccsys: vccsys {
127                 compatible = "regulator-fixed";
128                 regulator-name = "vccsys";
129                 regulator-boot-on;
130                 regulator-always-on;
131         };
132
133         vcc33_sys: vcc33-sys {
134                 vin-supply = <&vccsys>;
135         };
136
137         vcc_5v: vcc-5v {
138                 vin-supply = <&vccsys>;
139         };
140
141         /* This turns on vbus for host1 (dwc2) */
142         vcc5_host1: vcc5-host1-regulator {
143                 compatible = "regulator-fixed";
144                 enable-active-high;
145                 gpio = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
146                 pinctrl-names = "default";
147                 pinctrl-0 = <&host1_pwr_en>;
148                 regulator-name = "vcc5_host1";
149                 regulator-always-on;
150                 regulator-boot-on;
151         };
152
153         /* This turns on vbus for otg for host mode (dwc2) */
154         vcc5v_otg: vcc5v-otg-regulator {
155                 compatible = "regulator-fixed";
156                 enable-active-high;
157                 gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
158                 pinctrl-names = "default";
159                 pinctrl-0 = <&usbotg_pwren_h>;
160                 regulator-name = "vcc5_host2";
161                 regulator-always-on;
162                 regulator-boot-on;
163         };
164 };
165
166 &edp {
167         status = "okay";
168
169         pinctrl-names = "default";
170         pinctrl-0 = <&edp_hpd>;
171
172         ports {
173                 edp_out: port@1 {
174                         reg = <1>;
175                         #address-cells = <1>;
176                         #size-cells = <0>;
177                         edp_out_panel: endpoint {
178                                 reg = <0>;
179                                 remote-endpoint = <&panel_in_edp>;
180                         };
181                 };
182         };
183 };
184
185 &edp_phy {
186         status = "okay";
187 };
188
189 &gpio_keys {
190         pinctrl-0 = <&pwr_key_l &ap_lid_int_l>;
191         lid {
192                 label = "Lid";
193                 gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
194                 wakeup-source;
195                 linux,code = <0>; /* SW_LID */
196                 linux,input-type = <5>; /* EV_SW */
197                 debounce-interval = <1>;
198         };
199 };
200
201 &pwm0 {
202         status = "okay";
203 };
204
205 &rk808 {
206         vcc11-supply = <&vcc_5v>;
207
208         regulators {
209                 vcc33_ccd: LDO_REG8 {
210                         regulator-name = "vcc33_ccd";
211                         regulator-always-on;
212                         regulator-boot-on;
213                         regulator-min-microvolt = <3300000>;
214                         regulator-max-microvolt = <3300000>;
215                         regulator-state-mem {
216                                 regulator-on-in-suspend;
217                                 regulator-suspend-microvolt = <3300000>;
218                         };
219                 };
220         };
221 };
222
223 &spi0 {
224         status = "okay";
225
226         cros_ec: ec@0 {
227                 compatible = "google,cros-ec-spi";
228                 reg = <0>;
229                 google,cros-ec-spi-pre-delay = <30>;
230                 interrupt-parent = <&gpio7>;
231                 interrupts = <RK_PA7 IRQ_TYPE_LEVEL_LOW>;
232                 pinctrl-names = "default";
233                 pinctrl-0 = <&ec_int>;
234                 spi-max-frequency = <3000000>;
235
236                 i2c_tunnel: i2c-tunnel {
237                         compatible = "google,cros-ec-i2c-tunnel";
238                         google,remote-bus = <0>;
239                         #address-cells = <1>;
240                         #size-cells = <0>;
241                 };
242         };
243 };
244
245 &i2c4 {
246         trackpad@15 {
247                 compatible = "elan,ekth3000";
248                 reg = <0x15>;
249                 interrupt-parent = <&gpio7>;
250                 interrupts = <RK_PA3 IRQ_TYPE_EDGE_FALLING>;
251                 pinctrl-names = "default";
252                 pinctrl-0 = <&trackpad_int>;
253                 vcc-supply = <&vcc33_io>;
254                 wakeup-source;
255         };
256 };
257
258 &vopl {
259         status = "okay";
260 };
261
262 &vopl_mmu {
263         status = "okay";
264 };
265
266 &pinctrl {
267         pinctrl-0 = <
268                 /* Common for sleep and wake, but no owners */
269                 &global_pwroff
270
271                 /* Wake only */
272                 &suspend_l_wake
273         >;
274         pinctrl-1 = <
275                 /* Common for sleep and wake, but no owners */
276                 &global_pwroff
277
278                 /* Sleep only */
279                 &suspend_l_sleep
280         >;
281
282         backlight {
283                 bl_en: bl-en {
284                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
285                 };
286         };
287
288         buttons {
289                 ap_lid_int_l: ap-lid-int-l {
290                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_up>;
291                 };
292         };
293
294         charger {
295                 ac_present_ap: ac-present-ap {
296                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
297                 };
298         };
299
300         cros-ec {
301                 ec_int: ec-int {
302                         rockchip,pins = <7 7 RK_FUNC_GPIO &pcfg_pull_none>;
303                 };
304         };
305
306         suspend {
307                 suspend_l_wake: suspend-l-wake {
308                         rockchip,pins = <0 17 RK_FUNC_GPIO &pcfg_output_low>;
309                 };
310
311                 suspend_l_sleep: suspend-l-sleep {
312                         rockchip,pins = <0 17 RK_FUNC_GPIO &pcfg_output_high>;
313                 };
314         };
315
316         trackpad {
317                 trackpad_int: trackpad-int {
318                         rockchip,pins = <7 3 RK_FUNC_GPIO &pcfg_pull_up>;
319                 };
320         };
321
322         usb-host {
323                 host1_pwr_en: host1-pwr-en {
324                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_none>;
325                 };
326
327                 usbotg_pwren_h: usbotg-pwren-h {
328                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
329                 };
330         };
331 };
332
333 #include "cros-ec-keyboard.dtsi"