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,g12b";
15	model = "Beelink GT-King";
16
17	aliases {
18		rtc0 = &rtc;
19		rtc1 = &vrtc;
20	};
21
22	spdif_dit: audio-codec-1 {
23		#sound-dai-cells = <0>;
24		compatible = "linux,spdif-dit";
25		status = "okay";
26		sound-name-prefix = "DIT";
27	};
28
29	sound {
30		compatible = "amlogic,axg-sound-card";
31		model = "G12B-GTKING";
32		audio-aux-devs = <&tdmout_b>;
33		audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
34				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
35				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
36				"TDM_B Playback", "TDMOUT_B OUT",
37				"SPDIFOUT IN 0", "FRDDR_A OUT 3",
38				"SPDIFOUT IN 1", "FRDDR_B OUT 3",
39				"SPDIFOUT IN 2", "FRDDR_C OUT 3";
40
41		assigned-clocks = <&clkc CLKID_MPLL2>,
42				  <&clkc CLKID_MPLL0>,
43				  <&clkc CLKID_MPLL1>;
44		assigned-clock-parents = <0>, <0>, <0>;
45		assigned-clock-rates = <294912000>,
46				       <270950400>,
47				       <393216000>;
48		status = "okay";
49
50		dai-link-0 {
51			sound-dai = <&frddr_a>;
52		};
53
54		dai-link-1 {
55			sound-dai = <&frddr_b>;
56		};
57
58		dai-link-2 {
59			sound-dai = <&frddr_c>;
60		};
61
62		/* 8ch hdmi interface */
63		dai-link-3 {
64			sound-dai = <&tdmif_b>;
65			dai-format = "i2s";
66			dai-tdm-slot-tx-mask-0 = <1 1>;
67			dai-tdm-slot-tx-mask-1 = <1 1>;
68			dai-tdm-slot-tx-mask-2 = <1 1>;
69			dai-tdm-slot-tx-mask-3 = <1 1>;
70			mclk-fs = <256>;
71
72			codec {
73				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
74			};
75		};
76
77		/* spdif hdmi or toslink interface */
78		dai-link-4 {
79			sound-dai = <&spdifout>;
80
81			codec-0 {
82				sound-dai = <&spdif_dit>;
83			};
84
85			codec-1 {
86				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
87			};
88		};
89
90		/* spdif hdmi interface */
91		dai-link-5 {
92			sound-dai = <&spdifout_b>;
93
94			codec {
95				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
96			};
97		};
98
99		/* hdmi glue */
100		dai-link-6 {
101			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
102
103			codec {
104				sound-dai = <&hdmi_tx>;
105			};
106		};
107	};
108};
109
110&arb {
111	status = "okay";
112};
113
114&clkc_audio {
115	status = "okay";
116};
117
118&frddr_a {
119	status = "okay";
120};
121
122&frddr_b {
123	status = "okay";
124};
125
126&frddr_c {
127	status = "okay";
128};
129
130
131&i2c3 {
132	status = "okay";
133	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
134	pinctrl-names = "default";
135
136	rtc: rtc@51 {
137		compatible = "nxp,pcf8563";
138		reg = <0x51>;
139		wakeup-source;
140	};
141};
142
143&spdifout {
144	pinctrl-0 = <&spdif_out_h_pins>;
145	pinctrl-names = "default";
146	status = "okay";
147};
148
149&spdifout_b {
150	status = "okay";
151};
152
153&tdmif_b {
154	status = "okay";
155};
156
157&tdmout_b {
158	status = "okay";
159};
160
161&tohdmitx {
162	status = "okay";
163};
164