1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/linux-event-codes.h>
7 #include <dt-bindings/leds/common.h>
8 #include <dt-bindings/pinctrl/rockchip.h>
9 #include <dt-bindings/soc/rockchip,vop2.h>
10 #include "rk3566.dtsi"
14 stdout-path = "serial2:1500000n8";
18 compatible = "adc-joystick";
19 io-channels = <&adc_mux 0>,
23 pinctrl-0 = <&joy_mux_en>;
24 pinctrl-names = "default";
32 abs-range = <1023 15>;
40 abs-range = <15 1023>;
41 linux,code = <ABS_RX>;
48 abs-range = <15 1023>;
56 abs-range = <1023 15>;
57 linux,code = <ABS_RY>;
62 compatible = "adc-keys";
63 io-channels = <&saradc 0>;
64 io-channel-names = "buttons";
65 keyup-threshold-microvolt = <1800000>;
69 * Button is mapped to F key in BSP kernel, but
70 * according to input guidelines it should be mode.
74 linux,code = <BTN_MODE>;
75 press-threshold-microvolt = <1750>;
80 compatible = "io-channel-mux";
81 channels = "left_x", "right_x", "left_y", "right_y";
82 #io-channel-cells = <1>;
83 io-channels = <&saradc 3>;
84 io-channel-names = "parent";
85 mux-controls = <&gpio_mux>;
86 settle-time-us = <100>;
89 gpio_keys_control: gpio-keys-control {
90 compatible = "gpio-keys";
91 pinctrl-0 = <&btn_pins_ctrl>;
92 pinctrl-names = "default";
95 gpios = <&gpio3 RK_PC3 GPIO_ACTIVE_LOW>;
97 linux,code = <BTN_SOUTH>;
101 gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_LOW>;
103 linux,code = <BTN_DPAD_DOWN>;
107 gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>;
109 linux,code = <BTN_TL>;
113 gpios = <&gpio3 RK_PB2 GPIO_ACTIVE_LOW>;
115 linux,code = <BTN_TL2>;
119 gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_LOW>;
121 linux,code = <BTN_SELECT>;
125 gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_LOW>;
127 linux,code = <BTN_START>;
131 gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
133 linux,code = <BTN_THUMBL>;
137 gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>;
139 linux,code = <BTN_THUMBR>;
143 gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>;
145 linux,code = <BTN_DPAD_UP>;
149 gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
151 linux,code = <BTN_NORTH>;
155 gpio_keys_vol: gpio-keys-vol {
156 compatible = "gpio-keys";
158 pinctrl-0 = <&btn_pins_vol>;
159 pinctrl-names = "default";
162 gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
163 label = "VOLUMEDOWN";
164 linux,code = <KEY_VOLUMEDOWN>;
168 gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>;
170 linux,code = <KEY_VOLUMEUP>;
174 gpio_mux: mux-controller {
175 compatible = "gpio-mux";
176 mux-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>,
177 <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>;
178 #mux-control-cells = <0>;
182 compatible = "hdmi-connector";
183 ddc-i2c-bus = <&i2c5>;
187 hdmi_con_in: endpoint {
188 remote-endpoint = <&hdmi_out_con>;
194 compatible = "gpio-leds";
195 pinctrl-0 = <&led_pins>;
196 pinctrl-names = "default";
199 color = <LED_COLOR_ID_GREEN>;
200 default-state = "on";
201 function = LED_FUNCTION_POWER;
202 gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
206 color = <LED_COLOR_ID_AMBER>;
207 function = LED_FUNCTION_CHARGING;
208 gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
209 retain-state-suspended;
213 color = <LED_COLOR_ID_RED>;
214 default-state = "off";
215 function = LED_FUNCTION_STATUS;
216 gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
220 /* Channels reversed for both headphones and speakers. */
222 compatible = "simple-audio-card";
223 simple-audio-card,name = "anbernic_rk817";
224 simple-audio-card,aux-devs = <&spk_amp>;
225 simple-audio-card,format = "i2s";
226 simple-audio-card,hp-det-gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
227 simple-audio-card,mclk-fs = <256>;
228 simple-audio-card,widgets =
229 "Microphone", "Mic Jack",
230 "Headphone", "Headphones",
231 "Speaker", "Internal Speakers";
232 simple-audio-card,routing =
234 "Headphones", "HPOL",
235 "Headphones", "HPOR",
236 "Internal Speakers", "Speaker Amp OUTL",
237 "Internal Speakers", "Speaker Amp OUTR",
238 "Speaker Amp INL", "HPOL",
239 "Speaker Amp INR", "HPOR";
240 simple-audio-card,pin-switches = "Internal Speakers";
242 simple-audio-card,codec {
243 sound-dai = <&rk817>;
246 simple-audio-card,cpu {
247 sound-dai = <&i2s1_8ch>;
251 sdio_pwrseq: sdio-pwrseq {
252 compatible = "mmc-pwrseq-simple";
254 clock-names = "ext_clock";
255 pinctrl-0 = <&wifi_enable_h>;
256 pinctrl-names = "default";
257 post-power-on-delay-ms = <200>;
258 reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_LOW>;
261 spk_amp: audio-amplifier {
262 compatible = "simple-audio-amplifier";
263 enable-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
264 pinctrl-0 = <&spk_amp_enable_h>;
265 pinctrl-names = "default";
266 sound-name-prefix = "Speaker Amp";
269 vcc3v3_lcd0_n: regulator-vcc3v3-lcd0 {
270 compatible = "regulator-fixed";
271 gpio = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
273 pinctrl-0 = <&vcc_lcd_h>;
274 pinctrl-names = "default";
276 regulator-min-microvolt = <3300000>;
277 regulator-max-microvolt = <3300000>;
278 regulator-name = "vcc3v3_lcd0_n";
279 vin-supply = <&vcc_3v3>;
280 regulator-state-mem {
281 regulator-off-in-suspend;
285 vcc_sys: regulator-vcc-sys {
286 compatible = "regulator-fixed";
289 regulator-min-microvolt = <3800000>;
290 regulator-max-microvolt = <3800000>;
291 regulator-name = "vcc_sys";
294 vcc_wifi: regulator-vcc-wifi {
295 compatible = "regulator-fixed";
297 gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
298 pinctrl-0 = <&vcc_wifi_h>;
299 pinctrl-names = "default";
302 regulator-min-microvolt = <3300000>;
303 regulator-max-microvolt = <3300000>;
304 regulator-name = "vcc_wifi";
307 vibrator: pwm-vibrator {
308 compatible = "pwm-vibrator";
309 pwm-names = "enable";
310 pwms = <&pwm5 0 1000000000 0>;
319 cpu-supply = <&vdd_cpu>;
323 cpu-supply = <&vdd_cpu>;
327 cpu-supply = <&vdd_cpu>;
331 cpu-supply = <&vdd_cpu>;
335 mali-supply = <&vdd_gpu>;
340 ddc-i2c-bus = <&i2c5>;
341 pinctrl-0 = <&hdmitxm0_cec>;
342 pinctrl-names = "default";
347 hdmi_in_vp0: endpoint {
348 remote-endpoint = <&vp0_out_hdmi>;
353 hdmi_out_con: endpoint {
354 remote-endpoint = <&hdmi_con_in>;
366 compatible = "rockchip,rk817";
368 interrupt-parent = <&gpio0>;
369 interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
370 clock-output-names = "rk808-clkout1", "rk808-clkout2";
371 clock-names = "mclk";
372 clocks = <&cru I2S1_MCLKOUT_TX>;
373 assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
374 assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
376 #sound-dai-cells = <0>;
377 pinctrl-names = "default";
378 pinctrl-0 = <&i2s1m0_mclk>, <&pmic_int_l>;
381 vcc1-supply = <&vcc_sys>;
382 vcc2-supply = <&vcc_sys>;
383 vcc3-supply = <&vcc_sys>;
384 vcc4-supply = <&vcc_sys>;
385 vcc5-supply = <&vcc_sys>;
386 vcc6-supply = <&vcc_sys>;
387 vcc7-supply = <&vcc_sys>;
388 vcc8-supply = <&vcc_sys>;
389 vcc9-supply = <&dcdc_boost>;
392 vdd_logic: DCDC_REG1 {
395 regulator-min-microvolt = <500000>;
396 regulator-max-microvolt = <1350000>;
397 regulator-init-microvolt = <900000>;
398 regulator-ramp-delay = <6001>;
399 regulator-initial-mode = <0x2>;
400 regulator-name = "vdd_logic";
401 regulator-state-mem {
402 regulator-off-in-suspend;
403 regulator-suspend-microvolt = <900000>;
410 regulator-min-microvolt = <500000>;
411 regulator-max-microvolt = <1350000>;
412 regulator-init-microvolt = <900000>;
413 regulator-ramp-delay = <6001>;
414 regulator-initial-mode = <0x2>;
415 regulator-name = "vdd_gpu";
416 regulator-state-mem {
417 regulator-off-in-suspend;
424 regulator-initial-mode = <0x2>;
425 regulator-name = "vcc_ddr";
426 regulator-state-mem {
427 regulator-on-in-suspend;
434 regulator-min-microvolt = <3300000>;
435 regulator-max-microvolt = <3300000>;
436 regulator-initial-mode = <0x2>;
437 regulator-name = "vcc_3v3";
438 regulator-state-mem {
439 regulator-on-in-suspend;
440 regulator-suspend-microvolt = <3300000>;
444 vcca1v8_pmu: LDO_REG1 {
447 regulator-min-microvolt = <1800000>;
448 regulator-max-microvolt = <1800000>;
449 regulator-name = "vcca1v8_pmu";
450 regulator-state-mem {
451 regulator-on-in-suspend;
452 regulator-suspend-microvolt = <1800000>;
459 regulator-min-microvolt = <900000>;
460 regulator-max-microvolt = <900000>;
461 regulator-name = "vdda_0v9";
462 regulator-state-mem {
463 regulator-off-in-suspend;
467 vdda0v9_pmu: LDO_REG3 {
470 regulator-min-microvolt = <900000>;
471 regulator-max-microvolt = <900000>;
472 regulator-name = "vdda0v9_pmu";
473 regulator-state-mem {
474 regulator-on-in-suspend;
475 regulator-suspend-microvolt = <900000>;
479 vccio_acodec: LDO_REG4 {
482 regulator-min-microvolt = <3300000>;
483 regulator-max-microvolt = <3300000>;
484 regulator-name = "vccio_acodec";
485 regulator-state-mem {
486 regulator-off-in-suspend;
493 regulator-min-microvolt = <1800000>;
494 regulator-max-microvolt = <3300000>;
495 regulator-name = "vccio_sd";
496 regulator-state-mem {
497 regulator-off-in-suspend;
501 vcc3v3_pmu: LDO_REG6 {
504 regulator-min-microvolt = <3300000>;
505 regulator-max-microvolt = <3300000>;
506 regulator-name = "vcc3v3_pmu";
507 regulator-state-mem {
508 regulator-on-in-suspend;
509 regulator-suspend-microvolt = <3300000>;
516 regulator-min-microvolt = <1800000>;
517 regulator-max-microvolt = <1800000>;
518 regulator-name = "vcc_1v8";
519 regulator-state-mem {
520 regulator-off-in-suspend;
524 vcc1v8_dvp: LDO_REG8 {
527 regulator-min-microvolt = <1800000>;
528 regulator-max-microvolt = <3300000>;
529 regulator-name = "vcc1v8_dvp";
530 regulator-state-mem {
531 regulator-off-in-suspend;
535 vcc2v8_dvp: LDO_REG9 {
538 regulator-min-microvolt = <2800000>;
539 regulator-max-microvolt = <2800000>;
540 regulator-name = "vcc2v8_dvp";
541 regulator-state-mem {
542 regulator-off-in-suspend;
549 regulator-min-microvolt = <4700000>;
550 regulator-max-microvolt = <5400000>;
551 regulator-name = "boost";
552 regulator-state-mem {
553 regulator-off-in-suspend;
557 otg_switch: OTG_SWITCH {
558 regulator-name = "otg_switch";
559 regulator-state-mem {
560 regulator-off-in-suspend;
566 vdd_cpu: regulator@40 {
567 compatible = "fcs,fan53555";
569 fcs,suspend-voltage-selector = <1>;
572 regulator-min-microvolt = <712500>;
573 regulator-max-microvolt = <1390000>;
574 regulator-init-microvolt = <900000>;
575 regulator-name = "vdd_cpu";
576 regulator-ramp-delay = <2300>;
577 vin-supply = <&vcc_sys>;
578 regulator-state-mem {
579 regulator-off-in-suspend;
585 /* Unknown/unused device at 0x3c */
590 pinctrl-0 = <&i2c5m1_xfer>;
591 pinctrl-names = "default";
600 pinctrl-0 = <&i2s1m0_sclktx
604 pinctrl-names = "default";
605 rockchip,trcm-sync-tx-only;
611 spk_amp_enable_h: spk-amp-enable-h {
613 <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
618 btn_pins_ctrl: btn-pins-ctrl {
620 <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>,
621 <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
622 <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>,
623 <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>,
624 <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
625 <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
626 <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>,
627 <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>,
628 <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>,
629 <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>,
630 <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>,
631 <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>,
632 <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>,
633 <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>,
634 <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>,
635 <3 RK_PC3 RK_FUNC_GPIO &pcfg_pull_up>;
638 btn_pins_vol: btn-pins-vol {
640 <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
641 <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
648 <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>,
649 <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>,
650 <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
655 joy_mux_en: joy-mux-en {
657 <0 RK_PB5 RK_FUNC_GPIO &pcfg_output_low>;
662 pmic_int_l: pmic-int-l {
664 <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
669 wifi_enable_h: wifi-enable-h {
671 <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
676 vcc_lcd_h: vcc-lcd-h {
678 <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
683 vcc_wifi_h: vcc-wifi-h {
685 <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
692 pmuio1-supply = <&vcc3v3_pmu>;
693 pmuio2-supply = <&vcc3v3_pmu>;
694 vccio1-supply = <&vccio_acodec>;
695 vccio3-supply = <&vccio_sd>;
696 vccio4-supply = <&vcc_1v8>;
697 vccio5-supply = <&vcc_3v3>;
698 vccio6-supply = <&vcc1v8_dvp>;
699 vccio7-supply = <&vcc_3v3>;
707 vref-supply = <&vcc_1v8>;
714 cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
716 pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
717 pinctrl-names = "default";
719 vmmc-supply = <&vcc_3v3>;
720 vqmmc-supply = <&vccio_sd>;
727 cd-gpios = <&gpio2 RK_PB2 GPIO_ACTIVE_LOW>;
729 pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk &sdmmc1_det>;
730 pinctrl-names = "default";
732 vmmc-supply = <&vcc_3v3>;
733 vqmmc-supply = <&vcc1v8_dvp>;
741 keep-power-in-suspend;
742 mmc-pwrseq = <&sdio_pwrseq>;
744 pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_cmd &sdmmc2m0_clk>;
745 pinctrl-names = "default";
746 vmmc-supply = <&vcc_wifi>;
747 vqmmc-supply = <&vcca1v8_pmu>;
752 rockchip,hw-tshut-mode = <1>;
753 rockchip,hw-tshut-polarity = <0>;
758 pinctrl-0 = <&uart1m1_xfer &uart1m1_ctsn &uart1m1_rtsn>;
759 pinctrl-names = "default";
764 compatible = "realtek,rtl8821cs-bt";
765 device-wake-gpios = <&gpio4 4 GPIO_ACTIVE_HIGH>;
766 enable-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
767 host-wake-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
776 * Lack the schematics to verify, but port works as a peripheral
777 * (and not a host or OTG port).
780 dr_mode = "peripheral";
781 phys = <&usb2phy0_otg>;
782 phy-names = "usb2-phy";
795 phy-names = "usb2-phy", "usb3-phy";
796 phys = <&usb2phy1_host>, <&combphy1 PHY_TYPE_USB3>;
817 assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
818 assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
827 vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
828 reg = <ROCKCHIP_VOP2_EP_HDMI0>;
829 remote-endpoint = <&hdmi_in_vp0>;