1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
6 */
7
8/dts-v1/;
9
10#include "meson-g12b-w400.dtsi"
11#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
12
13/ {
14	compatible = "azw,gtking", "amlogic,s922x", "amlogic,g12b";
15	model = "Beelink GT-King Pro";
16
17	aliases {
18		rtc0 = &rtc;
19		rtc1 = &vrtc;
20	};
21
22	gpio-keys-polled {
23		compatible = "gpio-keys-polled";
24		#address-cells = <1>;
25		#size-cells = <0>;
26		poll-interval = <100>;
27
28		power-button {
29			label = "power";
30			linux,code = <KEY_POWER>;
31			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
32		};
33	};
34
35	leds {
36		compatible = "gpio-leds";
37
38		led-white {
39			label = "power:white";
40			gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
41			default-state = "on";
42		};
43	};
44
45	sound {
46		compatible = "amlogic,axg-sound-card";
47		model = "GTKING-PRO";
48		audio-aux-devs = <&tdmout_b>;
49		audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
50				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
51				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
52				"TDM_B Playback", "TDMOUT_B OUT";
53
54		assigned-clocks = <&clkc CLKID_MPLL2>,
55				  <&clkc CLKID_MPLL0>,
56				  <&clkc CLKID_MPLL1>;
57		assigned-clock-parents = <0>, <0>, <0>;
58		assigned-clock-rates = <294912000>,
59				       <270950400>,
60				       <393216000>;
61		status = "okay";
62
63		dai-link-0 {
64			sound-dai = <&frddr_a>;
65		};
66
67		dai-link-1 {
68			sound-dai = <&frddr_b>;
69		};
70
71		dai-link-2 {
72			sound-dai = <&frddr_c>;
73		};
74
75		/* 8ch hdmi interface */
76		dai-link-3 {
77			sound-dai = <&tdmif_b>;
78			dai-format = "i2s";
79			dai-tdm-slot-tx-mask-0 = <1 1>;
80			dai-tdm-slot-tx-mask-1 = <1 1>;
81			dai-tdm-slot-tx-mask-2 = <1 1>;
82			dai-tdm-slot-tx-mask-3 = <1 1>;
83			mclk-fs = <256>;
84
85			codec {
86				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
87			};
88		};
89
90		dai-link-4 {
91			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
92
93			codec {
94				sound-dai = <&hdmi_tx>;
95			};
96		};
97	};
98};
99
100&arb {
101	status = "okay";
102};
103
104&clkc_audio {
105	status = "okay";
106};
107
108&frddr_a {
109	status = "okay";
110};
111
112&frddr_b {
113	status = "okay";
114};
115
116&frddr_c {
117	status = "okay";
118};
119
120&i2c3 {
121	status = "okay";
122	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
123	pinctrl-names = "default";
124
125	rtc: rtc@51 {
126		compatible = "nxp,pcf8563";
127		reg = <0x51>;
128		wakeup-source;
129	};
130};
131
132&tdmif_b {
133	status = "okay";
134};
135
136&tdmout_b {
137	status = "okay";
138};
139
140&tohdmitx {
141	status = "okay";
142};
143