ARM64: dts: rockchip: add backlight support for rk3399-tb
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-tb.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 <dt-bindings/pwm/pwm.h>
44 #include "rk3399.dtsi"
45
46 / {
47         compatible = "rockchip,tb", "rockchip,rk3399";
48
49         vdd_log: vdd-log {
50                 compatible = "pwm-regulator";
51                 pwms = <&pwm2 0 1000>;
52                 regulator-name = "vdd_log";
53                 regulator-min-microvolt = <800000>;
54                 regulator-max-microvolt = <1400000>;
55                 regulator-always-on;
56                 status = "okay";
57         };
58
59         vdd_center: vdd-center {
60                 compatible = "pwm-regulator";
61                 pwms = <&pwm3 0 1000>;
62                 regulator-name = "vdd_center";
63                 regulator-min-microvolt = <800000>;
64                 regulator-max-microvolt = <1400000>;
65                 regulator-always-on;
66                 status = "okay";
67         };
68
69         vcc3v3_sys: vcc3v3-sys {
70                 compatible = "regulator-fixed";
71                 regulator-name = "vcc3v3_sys";
72                 regulator-always-on;
73                 regulator-boot-on;
74                 regulator-min-microvolt = <3300000>;
75                 regulator-max-microvolt = <3300000>;
76         };
77
78         backlight: backlight {
79                 compatible = "pwm-backlight";
80                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
81                 brightness-levels = <
82                           0   1   2   3   4   5   6   7
83                           8   9  10  11  12  13  14  15
84                          16  17  18  19  20  21  22  23
85                          24  25  26  27  28  29  30  31
86                          32  33  34  35  36  37  38  39
87                          40  41  42  43  44  45  46  47
88                          48  49  50  51  52  53  54  55
89                          56  57  58  59  60  61  62  63
90                          64  65  66  67  68  69  70  71
91                          72  73  74  75  76  77  78  79
92                          80  81  82  83  84  85  86  87
93                          88  89  90  91  92  93  94  95
94                          96  97  98  99 100 101 102 103
95                         104 105 106 107 108 109 110 111
96                         112 113 114 115 116 117 118 119
97                         120 121 122 123 124 125 126 127
98                         128 129 130 131 132 133 134 135
99                         136 137 138 139 140 141 142 143
100                         144 145 146 147 148 149 150 151
101                         152 153 154 155 156 157 158 159
102                         160 161 162 163 164 165 166 167
103                         168 169 170 171 172 173 174 175
104                         176 177 178 179 180 181 182 183
105                         184 185 186 187 188 189 190 191
106                         192 193 194 195 196 197 198 199
107                         200 201 202 203 204 205 206 207
108                         208 209 210 211 212 213 214 215
109                         216 217 218 219 220 221 222 223
110                         224 225 226 227 228 229 230 231
111                         232 233 234 235 236 237 238 239
112                         240 241 242 243 244 245 246 247
113                         248 249 250 251 252 253 254 255>;
114                 default-brightness-level = <200>;
115                 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
116         };
117 };
118
119 &i2s0 {
120         status = "okay";
121 };
122
123 &i2c0 {
124         status = "okay";
125
126         rk808: pmic@1b {
127                 compatible = "rockchip,rk808";
128                 reg = <0x1b>;
129                 interrupt-parent = <&gpio1>;
130                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
131                 pinctrl-names = "default";
132                 pinctrl-0 = <&pmic_int_l>;
133                 rockchip,system-power-controller;
134                 wakeup-source;
135                 #clock-cells = <1>;
136                 clock-output-names = "xin32k", "rk808-clkout2";
137
138                 vcc1-supply = <&vcc3v3_sys>;
139                 vcc2-supply = <&vcc3v3_sys>;
140                 vcc3-supply = <&vcc3v3_sys>;
141                 vcc4-supply = <&vcc3v3_sys>;
142                 vcc6-supply = <&vcc3v3_sys>;
143                 vcc7-supply = <&vcc3v3_sys>;
144                 vcc8-supply = <&vcc3v3_sys>;
145                 vcc9-supply = <&vcc3v3_sys>;
146                 vcc10-supply = <&vcc3v3_sys>;
147                 vcc11-supply = <&vcc3v3_sys>;
148                 vcc12-supply = <&vcc3v3_sys>;
149                 vddio-supply = <&vcc1v8_pmu>;
150
151                 regulators {
152                         vdd_cpu_b: DCDC_REG1 {
153                                 regulator-always-on;
154                                 regulator-boot-on;
155                                 regulator-min-microvolt = <750000>;
156                                 regulator-max-microvolt = <1350000>;
157                                 regulator-name = "vdd_cpu_b";
158                                 regulator-state-mem {
159                                         regulator-off-in-suspend;
160                                 };
161                         };
162
163                         vdd_cpu_l: DCDC_REG2 {
164                                 regulator-always-on;
165                                 regulator-boot-on;
166                                 regulator-min-microvolt = <750000>;
167                                 regulator-max-microvolt = <1350000>;
168                                 regulator-name = "vdd_cpu_l";
169                                 regulator-state-mem {
170                                         regulator-off-in-suspend;
171                                 };
172                         };
173
174                         vcc_ddr: DCDC_REG3 {
175                                 regulator-always-on;
176                                 regulator-boot-on;
177                                 regulator-name = "vcc_ddr";
178                                 regulator-state-mem {
179                                         regulator-on-in-suspend;
180                                 };
181                         };
182
183                         vcc_1v8: DCDC_REG4 {
184                                 regulator-always-on;
185                                 regulator-boot-on;
186                                 regulator-min-microvolt = <1800000>;
187                                 regulator-max-microvolt = <1800000>;
188                                 regulator-name = "vcc_1v8";
189                                 regulator-state-mem {
190                                         regulator-on-in-suspend;
191                                         regulator-suspend-microvolt = <1800000>;
192                                 };
193                         };
194
195                         vcc1v8_dvp: LDO_REG1 {
196                                 regulator-always-on;
197                                 regulator-boot-on;
198                                 regulator-min-microvolt = <1800000>;
199                                 regulator-max-microvolt = <1800000>;
200                                 regulator-name = "vcc1v8_dvp";
201                                 regulator-state-mem {
202                                         regulator-on-in-suspend;
203                                         regulator-suspend-microvolt = <1800000>;
204                                 };
205                         };
206
207                         vcc3v0_tp: LDO_REG2 {
208                                 regulator-always-on;
209                                 regulator-boot-on;
210                                 regulator-min-microvolt = <3000000>;
211                                 regulator-max-microvolt = <3000000>;
212                                 regulator-name = "vcc3v0_tp";
213                                 regulator-state-mem {
214                                         regulator-off-in-suspend;
215                                 };
216                         };
217
218                         vcc1v8_pmu: LDO_REG3 {
219                                 regulator-always-on;
220                                 regulator-boot-on;
221                                 regulator-min-microvolt = <1800000>;
222                                 regulator-max-microvolt = <1800000>;
223                                 regulator-name = "vcc1v8_pmu";
224                                 regulator-state-mem {
225                                         regulator-on-in-suspend;
226                                         regulator-suspend-microvolt = <1800000>;
227                                 };
228                         };
229
230                         vcc_sd: LDO_REG4 {
231                                 regulator-always-on;
232                                 regulator-boot-on;
233                                 regulator-min-microvolt = <1800000>;
234                                 regulator-max-microvolt = <3300000>;
235                                 regulator-name = "vcc_sd";
236                                 regulator-state-mem {
237                                         regulator-on-in-suspend;
238                                         regulator-suspend-microvolt = <3300000>;
239                                 };
240                         };
241
242                         vcca3v0_codec: LDO_REG5 {
243                                 regulator-always-on;
244                                 regulator-boot-on;
245                                 regulator-min-microvolt = <3000000>;
246                                 regulator-max-microvolt = <3000000>;
247                                 regulator-name = "vcca3v0_codec";
248                                 regulator-state-mem {
249                                         regulator-on-in-suspend;
250                                         regulator-suspend-microvolt = <3000000>;
251                                 };
252                         };
253
254                         vcc_1v5: LDO_REG6 {
255                                 regulator-always-on;
256                                 regulator-boot-on;
257                                 regulator-min-microvolt = <1500000>;
258                                 regulator-max-microvolt = <1500000>;
259                                 regulator-name = "vcc_1v5";
260                                 regulator-state-mem {
261                                         regulator-on-in-suspend;
262                                         regulator-suspend-microvolt = <1500000>;
263                                 };
264                         };
265
266                         vcca1v8_codec: LDO_REG7 {
267                                 regulator-always-on;
268                                 regulator-boot-on;
269                                 regulator-min-microvolt = <1800000>;
270                                 regulator-max-microvolt = <1800000>;
271                                 regulator-name = "vcca1v8_codec";
272                                 regulator-state-mem {
273                                         regulator-on-in-suspend;
274                                         regulator-suspend-microvolt = <1800000>;
275                                 };
276                         };
277
278                         vcc_3v0: LDO_REG8 {
279                                 regulator-always-on;
280                                 regulator-boot-on;
281                                 regulator-min-microvolt = <3000000>;
282                                 regulator-max-microvolt = <3000000>;
283                                 regulator-name = "vcc_3v0";
284                                 regulator-state-mem {
285                                         regulator-on-in-suspend;
286                                         regulator-suspend-microvolt = <3000000>;
287                                 };
288                         };
289
290                         vcc3v3_s3: SWITCH_REG1 {
291                                 regulator-always-on;
292                                 regulator-boot-on;
293                                 regulator-name = "vcc3v3_s3";
294                                 regulator-state-mem {
295                                         regulator-on-in-suspend;
296                                 };
297                         };
298
299                         vcc3v3_s0: SWITCH_REG2 {
300                                 regulator-always-on;
301                                 regulator-boot-on;
302                                 regulator-name = "vcc3v3_s0";
303                                 regulator-state-mem {
304                                         regulator-on-in-suspend;
305                                 };
306                         };
307                 };
308         };
309 };
310
311 &pwm2 {
312         status = "okay";
313 };
314
315 &pwm3 {
316         status = "okay";
317 };
318
319 &tsadc {
320         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
321         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
322         status = "okay";
323 };
324
325 &uart2 {
326         status = "okay";
327 };
328
329 &usb_host0_echi {
330         status = "okay";
331 };
332
333 &usb_host0_ohci {
334         status = "okay";
335 };
336
337 &usb_host1_echi {
338         status = "okay";
339 };
340
341 &usb_host1_ohci {
342         status = "okay";
343 };
344
345 &pwm0 {
346         status = "okay";
347 };