ARM: dts: rockchip: Add SPDIF optical out on rk3288-firefly
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-firefly.dtsi
1 /*
2  * Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
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 "rk3288.dtsi"
44
45 / {
46         memory {
47                 device_type = "memory";
48                 reg = <0 0x80000000>;
49         };
50
51         dovdd_1v8: dovdd-1v8-regulator {
52                 compatible = "regulator-fixed";
53                 regulator-name = "dovdd_1v8";
54                 regulator-min-microvolt = <1800000>;
55                 regulator-max-microvolt = <1800000>;
56                 vin-supply = <&vcc28_dvp>;
57         };
58
59         ext_gmac: external-gmac-clock {
60                 compatible = "fixed-clock";
61                 #clock-cells = <0>;
62                 clock-frequency = <125000000>;
63                 clock-output-names = "ext_gmac";
64         };
65
66         io_domains: io-domains {
67                 compatible = "rockchip,rk3288-io-voltage-domain";
68                 rockchip,grf = <&grf>;
69
70                 audio-supply = <&vcca_33>;
71                 bb-supply = <&vcc_io>;
72                 dvp-supply = <&dovdd_1v8>;
73                 flash0-supply = <&vcc_flash>;
74                 flash1-supply = <&vcc_lan>;
75                 gpio30-supply = <&vcc_io>;
76                 gpio1830-supply = <&vcc_io>;
77                 lcdc-supply = <&vcc_io>;
78                 sdcard-supply = <&vccio_sd>;
79                 wifi-supply = <&vccio_wl>;
80         };
81
82         ir: ir-receiver {
83                 compatible = "gpio-ir-receiver";
84                 pinctrl-names = "default";
85                 pinctrl-0 = <&ir_int>;
86         };
87
88         keys: gpio-keys {
89                 compatible = "gpio-keys";
90                 #address-cells = <1>;
91                 #size-cells = <0>;
92
93                 button@0 {
94                         gpio-key,wakeup = <1>;
95                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
96                         label = "GPIO Power";
97                         linux,code = <116>;
98                         pinctrl-names = "default";
99                         pinctrl-0 = <&pwr_key>;
100                 };
101         };
102
103         leds {
104                 compatible = "gpio-leds";
105
106                 work {
107                         gpios = <&gpio8 1 GPIO_ACTIVE_LOW>;
108                         label = "firefly:blue:user";
109                         linux,default-trigger = "rc-feedback";
110                         pinctrl-names = "default";
111                         pinctrl-0 = <&work_led>;
112                 };
113
114                 power {
115                         gpios = <&gpio8 2 GPIO_ACTIVE_LOW>;
116                         label = "firefly:green:power";
117                         linux,default-trigger = "default-on";
118                         pinctrl-names = "default";
119                         pinctrl-0 = <&power_led>;
120                 };
121         };
122
123         sdio_pwrseq: sdio-pwrseq {
124                 compatible = "mmc-pwrseq-simple";
125                 clocks = <&hym8563>;
126                 clock-names = "ext_clock";
127                 pinctrl-names = "default";
128                 pinctrl-0 = <&wifi_enable_h>;
129
130                 /*
131                  * On the module itself this is one of these (depending
132                  * on the actual card populated):
133                  * - SDIO_RESET_L_WL_REG_ON
134                  * - PDN (power down when low)
135                  */
136                 reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
137         };
138
139         sound {
140                 compatible = "simple-audio-card";
141                 simple-audio-card,name = "SPDIF";
142                 simple-audio-card,dai-link@1 {
143                         cpu { sound-dai = <&spdif>; };
144                         codec { sound-dai = <&spdif_out>; };
145                 };
146         };
147
148         spdif_out: spdif-out {
149                 compatible = "linux,spdif-dit";
150                 #sound-dai-cells = <0>;
151         };
152
153         vbat_wl: vcc_sys: vsys-regulator {
154                 compatible = "regulator-fixed";
155                 regulator-name = "vcc_sys";
156                 regulator-min-microvolt = <5000000>;
157                 regulator-max-microvolt = <5000000>;
158                 regulator-always-on;
159                 regulator-boot-on;
160         };
161
162         vcc_sd: sdmmc-regulator {
163                 compatible = "regulator-fixed";
164                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
165                 pinctrl-names = "default";
166                 pinctrl-0 = <&sdmmc_pwr>;
167                 regulator-name = "vcc_sd";
168                 regulator-min-microvolt = <3300000>;
169                 regulator-max-microvolt = <3300000>;
170                 startup-delay-us = <100000>;
171                 vin-supply = <&vcc_io>;
172         };
173
174         vcc_flash: flash-regulator {
175                 compatible = "regulator-fixed";
176                 regulator-name = "vcc_flash";
177                 regulator-min-microvolt = <1800000>;
178                 regulator-max-microvolt = <1800000>;
179                 vin-supply = <&vcc_io>;
180         };
181
182         vcc_5v: usb-regulator {
183                 compatible = "regulator-fixed";
184                 regulator-name = "vcc_5v";
185                 regulator-min-microvolt = <5000000>;
186                 regulator-max-microvolt = <5000000>;
187                 regulator-always-on;
188                 regulator-boot-on;
189                 vin-supply = <&vcc_sys>;
190         };
191
192         vcc_host_5v: usb-host-regulator {
193                 compatible = "regulator-fixed";
194                 enable-active-high;
195                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
196                 pinctrl-names = "default";
197                 pinctrl-0 = <&host_vbus_drv>;
198                 regulator-name = "vcc_host_5v";
199                 regulator-min-microvolt = <5000000>;
200                 regulator-max-microvolt = <5000000>;
201                 regulator-always-on;
202                 vin-supply = <&vcc_5v>;
203         };
204
205         vcc_otg_5v: usb-otg-regulator {
206                 compatible = "regulator-fixed";
207                 enable-active-high;
208                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
209                 pinctrl-names = "default";
210                 pinctrl-0 = <&otg_vbus_drv>;
211                 regulator-name = "vcc_otg_5v";
212                 regulator-min-microvolt = <5000000>;
213                 regulator-max-microvolt = <5000000>;
214                 regulator-always-on;
215                 vin-supply = <&vcc_5v>;
216         };
217
218         /*
219          * A TT8142 creates both dovdd_1v8 and vcc28_dvp, controlled
220          * by the dvp_pwr pin.
221          */
222         vcc28_dvp: vcc28-dvp-regulator {
223                 compatible = "regulator-fixed";
224                 enable-active-high;
225                 gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
226                 pinctrl-names = "default";
227                 pinctrl-0 = <&dvp_pwr>;
228                 regulator-name = "vcc28_dvp";
229                 regulator-min-microvolt = <2800000>;
230                 regulator-max-microvolt = <2800000>;
231                 regulator-always-on;
232                 vin-supply = <&vcc_io>;
233         };
234
235         wireless-bluetooth {
236                 compatible = "bluetooth-platdata";
237                 uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
238                 pinctrl-names = "default", "rts_gpio";
239                 pinctrl-0 = <&uart0_rts>;
240                 pinctrl-1 = <&uart0_gpios>;
241                 BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
242                 BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
243                 BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
244                 status = "okay";
245         };
246
247         wireless-wlan {
248                 compatible = "wlan-platdata";
249                 rockchip,grf = <&grf>;
250                 wifi_chip_type = "ap6335";
251                 sdio_vref = <1800>;
252                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
253                 status = "okay";
254         };
255 };
256
257 &cpu0 {
258         cpu0-supply = <&vdd_cpu>;
259 };
260
261 &emmc {
262         bus-width = <8>;
263         cap-mmc-highspeed;
264         disable-wp;
265         non-removable;
266         num-slots = <1>;
267         pinctrl-names = "default";
268         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
269         vmmc-supply = <&vcc_io>;
270         vqmmc-supply = <&vcc_flash>;
271         status = "okay";
272 };
273
274 &gmac {
275         assigned-clocks = <&cru SCLK_MAC>;
276         assigned-clock-parents = <&ext_gmac>;
277         clock_in_out = "input";
278         pinctrl-names = "default";
279         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
280         phy-supply = <&vcc_lan>;
281         phy-mode = "rgmii";
282         snps,reset-active-low;
283         snps,reset-delays-us = <0 10000 1000000>;
284         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
285         tx_delay = <0x30>;
286         rx_delay = <0x10>;
287         status = "ok";
288 };
289
290 &hdmi {
291         ddc-i2c-bus = <&i2c5>;
292         status = "okay";
293 };
294
295 &i2c0 {
296         clock-frequency = <400000>;
297         status = "okay";
298
299         vdd_cpu: syr827@40 {
300                 compatible = "silergy,syr827";
301                 fcs,suspend-voltage-selector = <1>;
302                 reg = <0x40>;
303                 regulator-name = "vdd_cpu";
304                 regulator-min-microvolt = <850000>;
305                 regulator-max-microvolt = <1350000>;
306                 regulator-always-on;
307                 regulator-boot-on;
308                 regulator-enable-ramp-delay = <300>;
309                 regulator-ramp-delay = <8000>;
310                 vin-supply = <&vcc_sys>;
311         };
312
313         vdd_gpu: syr828@41 {
314                 compatible = "silergy,syr828";
315                 fcs,suspend-voltage-selector = <1>;
316                 reg = <0x41>;
317                 regulator-name = "vdd_gpu";
318                 regulator-min-microvolt = <850000>;
319                 regulator-max-microvolt = <1350000>;
320                 regulator-always-on;
321                 vin-supply = <&vcc_sys>;
322         };
323
324         hym8563: hym8563@51 {
325                 compatible = "haoyu,hym8563";
326                 reg = <0x51>;
327                 #clock-cells = <0>;
328                 clock-frequency = <32768>;
329                 clock-output-names = "xin32k";
330                 interrupt-parent = <&gpio7>;
331                 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
332                 pinctrl-names = "default";
333                 pinctrl-0 = <&rtc_int>;
334         };
335
336         act8846: act8846@5a {
337                 compatible = "active-semi,act8846";
338                 reg = <0x5a>;
339                 pinctrl-names = "default";
340                 pinctrl-0 = <&pmic_vsel>, <&pwr_hold>;
341                 system-power-controller;
342
343                 vp1-supply = <&vcc_sys>;
344                 vp2-supply = <&vcc_sys>;
345                 vp3-supply = <&vcc_sys>;
346                 vp4-supply = <&vcc_sys>;
347                 inl1-supply = <&vcc_sys>;
348                 inl2-supply = <&vcc_sys>;
349                 inl3-supply = <&vcc_20>;
350
351                 regulators {
352                         vcc_ddr: REG1 {
353                                 regulator-name = "vcc_ddr";
354                                 regulator-min-microvolt = <1200000>;
355                                 regulator-max-microvolt = <1200000>;
356                                 regulator-always-on;
357                         };
358
359                         vcc_io: REG2 {
360                                 regulator-name = "vcc_io";
361                                 regulator-min-microvolt = <3300000>;
362                                 regulator-max-microvolt = <3300000>;
363                                 regulator-always-on;
364                         };
365
366                         vdd_log: REG3 {
367                                 regulator-name = "vdd_log";
368                                 regulator-min-microvolt = <1100000>;
369                                 regulator-max-microvolt = <1100000>;
370                                 regulator-always-on;
371                         };
372
373                         vcc_20: REG4 {
374                                 regulator-name = "vcc_20";
375                                 regulator-min-microvolt = <2000000>;
376                                 regulator-max-microvolt = <2000000>;
377                                 regulator-always-on;
378                         };
379
380                         vccio_sd: REG5 {
381                                 regulator-name = "vccio_sd";
382                                 regulator-min-microvolt = <3300000>;
383                                 regulator-max-microvolt = <3300000>;
384                                 regulator-always-on;
385                         };
386
387                         vdd10_lcd: REG6 {
388                                 regulator-name = "vdd10_lcd";
389                                 regulator-min-microvolt = <1000000>;
390                                 regulator-max-microvolt = <1000000>;
391                                 regulator-always-on;
392                         };
393
394                         vcca_18: REG7 {
395                                 regulator-name = "vcca_18";
396                                 regulator-min-microvolt = <1800000>;
397                                 regulator-max-microvolt = <1800000>;
398                         };
399
400                         vcca_33: REG8 {
401                                 regulator-name = "vcca_33";
402                                 regulator-min-microvolt = <3300000>;
403                                 regulator-max-microvolt = <3300000>;
404                                 regulator-always-on;
405                         };
406
407                         vcc_lan: REG9 {
408                                 regulator-name = "vcc_lan";
409                                 regulator-min-microvolt = <3300000>;
410                                 regulator-max-microvolt = <3300000>;
411                         };
412
413                         vdd_10: REG10 {
414                                 regulator-name = "vdd_10";
415                                 regulator-min-microvolt = <1000000>;
416                                 regulator-max-microvolt = <1000000>;
417                                 regulator-always-on;
418                         };
419
420                         vccio_wl: vcc_18: REG11 {
421                                 regulator-name = "vcc_18";
422                                 regulator-min-microvolt = <1800000>;
423                                 regulator-max-microvolt = <1800000>;
424                                 regulator-always-on;
425                         };
426
427                         vcc18_lcd: REG12 {
428                                 regulator-name = "vcc18_lcd";
429                                 regulator-min-microvolt = <1800000>;
430                                 regulator-max-microvolt = <1800000>;
431                                 regulator-always-on;
432                         };
433                 };
434         };
435 };
436
437 &i2c1 {
438         status = "okay";
439 };
440
441 &i2c2 {
442         status = "okay";
443 };
444
445 &i2c4 {
446         status = "okay";
447 };
448
449 &i2c5 {
450         status = "okay";
451 };
452
453 &pinctrl {
454         pcfg_output_high: pcfg-output-high {
455                 output-high;
456         };
457
458         pcfg_output_low: pcfg-output-low {
459                 output-low;
460         };
461
462         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
463                 drive-strength = <8>;
464         };
465
466         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
467                 bias-pull-up;
468                 drive-strength = <8>;
469         };
470
471         act8846 {
472                 pwr_hold: pwr-hold {
473                         rockchip,pins = <0 1 RK_FUNC_GPIO &pcfg_output_high>;
474                 };
475         };
476
477         dvp {
478                 dvp_pwr: dvp-pwr {
479                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_none>;
480                 };
481         };
482
483         gmac {
484                 phy_int: phy-int {
485                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
486                 };
487
488                 phy_pmeb: phy-pmeb {
489                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
490                 };
491
492                 phy_rst: phy-rst {
493                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
494                 };
495         };
496
497         hym8563 {
498                 rtc_int: rtc-int {
499                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_up>;
500                 };
501         };
502
503         keys {
504                 pwr_key: pwr-key {
505                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
506                 };
507         };
508
509         leds {
510                 power_led: power-led {
511                         rockchip,pins = <8 2 RK_FUNC_GPIO &pcfg_pull_none>;
512                 };
513
514                 work_led: work-led {
515                         rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_none>;
516                 };
517         };
518
519         sdio-pwrseq {
520                 wifi_enable_h: wifi-enable-h {
521                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
522                 };
523         };
524
525         sdmmc {
526                 /*
527                  * Default drive strength isn't enough to achieve even
528                  * high-speed mode on firefly board so bump up to 8ma.
529                  */
530                 sdmmc_bus4: sdmmc-bus4 {
531                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
532                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
533                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
534                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
535                 };
536
537                 sdmmc_clk: sdmmc-clk {
538                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
539                 };
540
541                 sdmmc_cmd: sdmmc-cmd {
542                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
543                 };
544
545                 sdmmc_pwr: sdmmc-pwr {
546                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
547                 };
548         };
549
550         usb_host {
551                 host_vbus_drv: host-vbus-drv {
552                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
553                 };
554
555                 usbhub_rst: usbhub-rst {
556                         rockchip,pins = <8 3 RK_FUNC_GPIO &pcfg_output_high>;
557                 };
558         };
559
560         usb_otg {
561                 otg_vbus_drv: otg-vbus-drv {
562                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
563                 };
564         };
565
566         wireless-bluetooth {
567                 uart0_gpios: uart0-gpios {
568                         rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
569                 };
570         };
571 };
572
573 &saradc {
574         vref-supply = <&vcc_18>;
575         status = "okay";
576 };
577
578 &sdio0 {
579         clock-frequency = <50000000>;
580         clock-freq-min-max = <200000 50000000>;
581
582         bus-width = <4>;
583         cap-sd-highspeed;
584         cap-sdio-irq;
585         disable-wp;
586         keep-power-in-suspend;
587         mmc-pwrseq = <&sdio_pwrseq>;
588         non-removable;
589         num-slots = <1>;
590         pinctrl-names = "default";
591         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
592         sd-uhs-sdr104;
593         supports-sdio;
594         vmmc-supply = <&vbat_wl>;
595         vqmmc-supply = <&vccio_wl>;
596         status = "okay";
597 };
598
599 &sdmmc {
600         bus-width = <4>;
601         cap-mmc-highspeed;
602         cap-sd-highspeed;
603         card-detect-delay = <200>;
604         disable-wp;
605         num-slots = <1>;
606         pinctrl-names = "default";
607         pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
608         supports-sd;
609         vmmc-supply = <&vcc_sd>;
610         vqmmc-supply = <&vccio_sd>;
611         status = "okay";
612 };
613
614 &spdif {
615         status = "okay";
616 };
617
618 &spi0 {
619         pinctrl-names = "default";
620         pinctrl-0 = <&spi0_clk>, <&spi0_cs0>, <&spi0_tx>, <&spi0_rx>, <&spi0_cs1>;
621         status = "okay";
622 };
623
624 &tsadc {
625         rockchip,hw-tshut-mode = <0>;
626         rockchip,hw-tshut-polarity = <0>;
627         status = "okay";
628 };
629
630 &uart0 {
631         pinctrl-names = "default";
632         pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
633         status = "okay";
634 };
635
636 &uart1 {
637         status = "okay";
638 };
639
640 &uart2 {
641         status = "okay";
642 };
643
644 &uart3 {
645         status = "okay";
646 };
647
648 &usbphy {
649         status = "okay";
650 };
651
652 &usb_host1 {
653         pinctrl-names = "default";
654         pinctrl-0 = <&usbhub_rst>;
655         status = "okay";
656 };
657
658 &usb_otg {
659         status = "okay";
660 };
661
662 &vopb {
663         status = "okay";
664 };
665
666 &vopb_mmu {
667         status = "okay";
668 };
669
670 &vopl {
671         status = "okay";
672 };
673
674 &vopl_mmu {
675         status = "okay";
676 };
677
678 &vpu {
679         status = "okay";
680 };
681
682 &wdt {
683         status = "okay";
684 };