1// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2/*
3 * Copyright (C) 2019-2020 Marek Vasut <marex@denx.de>
4 * Copyright (C) 2022 DH electronics GmbH
5 */
6
7/ {
8	aliases {
9		serial0 = &uart4;
10		serial1 = &usart3;
11		serial2 = &uart8;
12	};
13
14	chosen {
15		stdout-path = "serial0:115200n8";
16	};
17
18	clk_ext_audio_codec: clock-codec {
19		compatible = "fixed-clock";
20		#clock-cells = <0>;
21		clock-frequency = <24000000>;
22	};
23
24	display_bl: display-bl {
25		compatible = "pwm-backlight";
26		pwms = <&pwm2 3 500000 1>;
27		brightness-levels = <0 16 22 30 40 55 75 102 138 188 255>;
28		default-brightness-level = <8>;
29		enable-gpios = <&gpioi 0 GPIO_ACTIVE_HIGH>;
30		power-supply = <&reg_panel_bl>;
31		status = "okay";
32	};
33
34	gpio-keys-polled {
35		compatible = "gpio-keys-polled";
36		poll-interval = <20>;
37
38		/*
39		 * The EXTi IRQ line 3 is shared with ethernet,
40		 * so mark this as polled GPIO key.
41		 */
42		button-0 {
43			label = "TA1-GPIO-A";
44			gpios = <&gpiof 3 GPIO_ACTIVE_LOW>;
45		};
46
47		/*
48		 * The EXTi IRQ line 6 is shared with touchscreen,
49		 * so mark this as polled GPIO key.
50		 */
51		button-1 {
52			label = "TA2-GPIO-B";
53			gpios = <&gpiod 6 GPIO_ACTIVE_LOW>;
54		};
55
56		/*
57		 * The EXTi IRQ line 0 is shared with PMIC,
58		 * so mark this as polled GPIO key.
59		 */
60		button-2 {
61			label = "TA3-GPIO-C";
62			gpios = <&gpiog 0 GPIO_ACTIVE_LOW>;
63		};
64	};
65
66	gpio-keys {
67		compatible = "gpio-keys";
68
69		button-3 {
70			label = "TA4-GPIO-D";
71			gpios = <&gpiod 12 GPIO_ACTIVE_LOW>;
72			wakeup-source;
73		};
74	};
75
76	led {
77		compatible = "gpio-leds";
78
79		led-0 {
80			label = "green:led5";
81			gpios = <&gpioc 6 GPIO_ACTIVE_HIGH>;
82			default-state = "off";
83			status = "disabled";
84		};
85
86		led-1 {
87			label = "green:led6";
88			gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
89			default-state = "off";
90		};
91
92		led-2 {
93			label = "green:led7";
94			gpios = <&gpioi 2 GPIO_ACTIVE_HIGH>;
95			default-state = "off";
96		};
97
98		led-3 {
99			label = "green:led8";
100			gpios = <&gpioi 3 GPIO_ACTIVE_HIGH>;
101			default-state = "off";
102		};
103	};
104
105	panel {
106		compatible = "edt,etm0700g0edh6";
107		backlight = <&display_bl>;
108		power-supply = <&reg_panel_bl>;
109
110		port {
111			lcd_panel_in: endpoint {
112				remote-endpoint = <&lcd_display_out>;
113			};
114		};
115	};
116
117	reg_panel_bl: regulator-panel-bl {
118		compatible = "regulator-fixed";
119		regulator-name = "panel_backlight";
120		regulator-min-microvolt = <3300000>;
121		regulator-max-microvolt = <3300000>;
122		vin-supply = <&reg_panel_supply>;
123	};
124
125	reg_panel_supply: regulator-panel-supply {
126		compatible = "regulator-fixed";
127		regulator-name = "panel_supply";
128		regulator-min-microvolt = <24000000>;
129		regulator-max-microvolt = <24000000>;
130	};
131
132	sound {
133		compatible = "audio-graph-card";
134		routing =
135			"MIC_IN", "Capture",
136			"Capture", "Mic Bias",
137			"Playback", "HP_OUT";
138		dais = <&sai2a_port &sai2b_port>;
139		status = "okay";
140	};
141};
142
143&cec {
144	pinctrl-names = "default";
145	pinctrl-0 = <&cec_pins_a>;
146	status = "okay";
147};
148
149&i2c2 {	/* Header X22 */
150	pinctrl-names = "default";
151	pinctrl-0 = <&i2c2_pins_a>;
152	i2c-scl-rising-time-ns = <185>;
153	i2c-scl-falling-time-ns = <20>;
154	status = "okay";
155	/* spare dmas for other usage */
156	/delete-property/dmas;
157	/delete-property/dma-names;
158};
159
160&i2c5 {	/* Header X21 */
161	pinctrl-names = "default";
162	pinctrl-0 = <&i2c5_pins_a>;
163	i2c-scl-rising-time-ns = <185>;
164	i2c-scl-falling-time-ns = <20>;
165	status = "okay";
166	/* spare dmas for other usage */
167	/delete-property/dmas;
168	/delete-property/dma-names;
169
170	sgtl5000: codec@a {
171		compatible = "fsl,sgtl5000";
172		reg = <0x0a>;
173		#sound-dai-cells = <0>;
174		clocks = <&clk_ext_audio_codec>;
175		VDDA-supply = <&v3v3>;
176		VDDIO-supply = <&vdd>;
177
178		sgtl5000_port: port {
179			#address-cells = <1>;
180			#size-cells = <0>;
181
182			sgtl5000_tx_endpoint: endpoint@0 {
183				reg = <0>;
184				remote-endpoint = <&sai2a_endpoint>;
185				frame-master = <&sgtl5000_tx_endpoint>;
186				bitclock-master = <&sgtl5000_tx_endpoint>;
187			};
188
189			sgtl5000_rx_endpoint: endpoint@1 {
190				reg = <1>;
191				remote-endpoint = <&sai2b_endpoint>;
192				frame-master = <&sgtl5000_rx_endpoint>;
193				bitclock-master = <&sgtl5000_rx_endpoint>;
194			};
195		};
196
197	};
198
199	touchscreen@38 {
200		compatible = "edt,edt-ft5406";
201		reg = <0x38>;
202		interrupt-parent = <&gpioc>;
203		interrupts = <6 IRQ_TYPE_EDGE_FALLING>; /* GPIO E */
204	};
205};
206
207&ltdc {
208	pinctrl-names = "default", "sleep";
209	pinctrl-0 = <&ltdc_pins_b>;
210	pinctrl-1 = <&ltdc_sleep_pins_b>;
211	status = "okay";
212
213	port {
214		lcd_display_out: endpoint {
215			remote-endpoint = <&lcd_panel_in>;
216		};
217	};
218};
219
220&sai2 {
221	clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
222	clock-names = "pclk", "x8k", "x11k";
223	pinctrl-names = "default", "sleep";
224	pinctrl-0 = <&sai2a_pins_b &sai2b_pins_b>;
225	pinctrl-1 = <&sai2a_sleep_pins_b &sai2b_sleep_pins_b>;
226	status = "okay";
227
228	sai2a: audio-controller@4400b004 {
229		#clock-cells = <0>;
230		dma-names = "tx";
231		clocks = <&rcc SAI2_K>;
232		clock-names = "sai_ck";
233		status = "okay";
234
235		sai2a_port: port {
236			sai2a_endpoint: endpoint {
237				remote-endpoint = <&sgtl5000_tx_endpoint>;
238				format = "i2s";
239				mclk-fs = <512>;
240				dai-tdm-slot-num = <2>;
241				dai-tdm-slot-width = <16>;
242			};
243		};
244	};
245
246	sai2b: audio-controller@4400b024 {
247		dma-names = "rx";
248		st,sync = <&sai2a 2>;
249		clocks = <&rcc SAI2_K>, <&sai2a>;
250		clock-names = "sai_ck", "MCLK";
251		status = "okay";
252
253		sai2b_port: port {
254			sai2b_endpoint: endpoint {
255				remote-endpoint = <&sgtl5000_rx_endpoint>;
256				format = "i2s";
257				mclk-fs = <512>;
258				dai-tdm-slot-num = <2>;
259				dai-tdm-slot-width = <16>;
260			};
261		};
262	};
263};
264
265&timers2 {
266	/* spare dmas for other usage (un-delete to enable pwm capture) */
267	/delete-property/dmas;
268	/delete-property/dma-names;
269	status = "okay";
270	pwm2: pwm {
271		pinctrl-0 = <&pwm2_pins_a>;
272		pinctrl-names = "default";
273		status = "okay";
274	};
275	timer@1 {
276		status = "okay";
277	};
278};
279
280&usart3 {
281	pinctrl-names = "default";
282	pinctrl-0 = <&usart3_pins_a>;
283	/delete-property/dmas;
284	/delete-property/dma-names;
285	status = "okay";
286};
287
288&uart8 {
289	pinctrl-names = "default";
290	pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>;
291	uart-has-rtscts;
292	/delete-property/dmas;
293	/delete-property/dma-names;
294	status = "okay";
295};
296
297&usbh_ehci {
298	phys = <&usbphyc_port0>;
299	status = "okay";
300};
301
302&usbotg_hs {
303	dr_mode = "otg";
304	pinctrl-0 = <&usbotg_hs_pins_a>;
305	pinctrl-names = "default";
306	phy-names = "usb2-phy";
307	phys = <&usbphyc_port1 0>;
308	vbus-supply = <&vbus_otg>;
309	status = "okay";
310};
311
312&usbphyc {
313	status = "okay";
314};
315
316&usbphyc_port0 {
317	phy-supply = <&vdd_usb>;
318};
319
320&usbphyc_port1 {
321	phy-supply = <&vdd_usb>;
322};
323