1// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2/*
3 * Copyright 2022 Toradex
4 */
5
6#include "imx8mm-verdin-dahlia.dtsi"
7
8/ {
9	sound_card: sound-card {
10		compatible = "simple-audio-card";
11		simple-audio-card,bitclock-master = <&dailink_master>;
12		simple-audio-card,format = "i2s";
13		simple-audio-card,frame-master = <&dailink_master>;
14		simple-audio-card,mclk-fs = <256>;
15		simple-audio-card,name = "imx8mm-nau8822";
16		simple-audio-card,routing =
17			"Headphones", "LHP",
18			"Headphones", "RHP",
19			"Speaker", "LSPK",
20			"Speaker", "RSPK",
21			"Line Out", "AUXOUT1",
22			"Line Out", "AUXOUT2",
23			"LAUX", "Line In",
24			"RAUX", "Line In",
25			"LMICP", "Mic In",
26			"RMICP", "Mic In";
27		simple-audio-card,widgets =
28			"Headphones", "Headphones",
29			"Line Out", "Line Out",
30			"Speaker", "Speaker",
31			"Microphone", "Mic In",
32			"Line", "Line In";
33
34		dailink_master: simple-audio-card,codec {
35			clocks = <&clk IMX8MM_CLK_SAI2_ROOT>;
36			sound-dai = <&nau8822_1a>;
37		};
38
39		simple-audio-card,cpu {
40			sound-dai = <&sai2>;
41		};
42	};
43};
44
45&gpio_expander_21 {
46	status = "okay";
47};
48
49/* Verdin I2C_1 */
50&i2c4 {
51	/* Audio Codec */
52	nau8822_1a: audio-codec@1a {
53		compatible = "nuvoton,nau8822";
54		reg = <0x1a>;
55	};
56};
57
58/* Verdin UART_1, connector X50 through RS485 transceiver */
59&uart2 {
60	linux,rs485-enabled-at-boot-time;
61	rs485-rts-active-low;
62	rs485-rx-during-tx;
63};
64
65/* Limit frequency on dev board due to long traces and bad signal integrity */
66&usdhc2 {
67	max-frequency = <100000000>;
68};
69