1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2018 Logic PD, Inc - https://www.logicpd.com/
4 */
5
6#include <dt-bindings/input/input.h>
7
8/ {
9	codec1 {
10		compatible = "simple-audio-card";
11		simple-audio-card,name = "tlv320aic23-hifi";
12
13		simple-audio-card,widgets =
14			"Microphone", "Mic In",
15			"Line", "Line In",
16			"Line", "Line Out";
17
18		simple-audio-card,routing =
19			"Line Out", "LOUT",
20			"Line Out", "ROUT",
21			"LLINEIN", "Line In",
22			"RLINEIN", "Line In",
23			"MICIN", "Mic In";
24
25		simple-audio-card,format = "i2s";
26		simple-audio-card,bitclock-master = <&sound_master>;
27		simple-audio-card,frame-master = <&sound_master>;
28
29		simple-audio-card,cpu {
30			sound-dai = <&mcbsp1>;
31		};
32
33		sound_master: simple-audio-card,codec {
34			sound-dai = <&tlv320aic23_1>;
35			system-clock-frequency = <12000000>;
36		};
37	};
38
39	codec2 {
40		compatible = "simple-audio-card";
41		simple-audio-card,name = "tlv320aic23-hifi";
42
43		simple-audio-card,widgets =
44			"Microphone", "Mic In",
45			"Line", "Line In",
46			"Line", "Line Out";
47
48		simple-audio-card,routing =
49			"Line Out", "LOUT",
50			"Line Out", "ROUT",
51			"LLINEIN", "Line In",
52			"RLINEIN", "Line In",
53			"MICIN", "Mic In";
54
55		simple-audio-card,format = "i2s";
56		simple-audio-card,bitclock-master = <&sound_master2>;
57		simple-audio-card,frame-master = <&sound_master2>;
58
59		simple-audio-card,cpu {
60			sound-dai = <&mcbsp2>;
61		};
62
63		sound_master2: simple-audio-card,codec {
64			sound-dai = <&tlv320aic23_2>;
65			system-clock-frequency = <12000000>;
66		};
67	};
68
69	expander-keys {
70		compatible = "gpio-keys-polled";
71		poll-interval = <100>;
72
73		key-record {
74			label = "Record";
75			/* linux,code = <BTN_0>; */
76			gpios = <&tca6416_2 15 GPIO_ACTIVE_LOW>;
77		};
78
79		key-play {
80			label = "Play";
81			linux,code = <KEY_PLAY>;
82			gpios = <&tca6416_2 14 GPIO_ACTIVE_LOW>;
83		};
84
85		key-stop {
86			label = "Stop";
87			linux,code = <KEY_STOP>;
88			gpios = <&tca6416_2 13 GPIO_ACTIVE_LOW>;
89		};
90
91		key-fwd {
92			label = "FWD";
93			linux,code = <KEY_FASTFORWARD>;
94			gpios = <&tca6416_2 12 GPIO_ACTIVE_LOW>;
95		};
96
97		key-rwd {
98			label = "RWD";
99			linux,code = <KEY_REWIND>;
100			gpios = <&tca6416_2 11 GPIO_ACTIVE_LOW>;
101		};
102
103		key-shift {
104			label = "Shift";
105			linux,code = <KEY_LEFTSHIFT>;
106			gpios = <&tca6416_2 10 GPIO_ACTIVE_LOW>;
107		};
108
109		key-mode {
110			label = "Mode";
111			linux,code = <BTN_MODE>;
112			gpios = <&tca6416_2 9 GPIO_ACTIVE_LOW>;
113		};
114
115		key-menu {
116			label = "Menu";
117			linux,code = <KEY_MENU>;
118			gpios = <&tca6416_2 8 GPIO_ACTIVE_LOW>;
119		};
120
121		key-up {
122			label = "Up";
123			linux,code = <KEY_UP>;
124			gpios = <&tca6416_2 7 GPIO_ACTIVE_LOW>;
125		};
126
127		key-down {
128			label = "Down";
129			linux,code = <KEY_DOWN>;
130			gpios = <&tca6416_2 6 GPIO_ACTIVE_LOW>;
131		};
132	};
133};
134
135&i2c2 {
136	/* Audio codecs */
137	tlv320aic23_1: codec@1a {
138		compatible = "ti,tlv320aic23";
139		reg = <0x1a>;
140		#sound-dai-cells = <0>;
141		status = "okay";
142	};
143
144	tlv320aic23_2: codec@1b {
145		compatible = "ti,tlv320aic23";
146		reg = <0x1b>;
147		#sound-dai-cells = <0>;
148		status = "okay";
149	};
150};
151
152&i2c3 {
153	/* Audio codecs */
154	tlv320aic23_3: codec@1a {
155		compatible = "ti,tlv320aic23";
156		reg = <0x1a>;
157		#sound-dai-cells = <0>;
158		status = "okay";
159	};
160
161	/* GPIO Expanders */
162	tca6416_2: gpio@20 {
163		compatible = "ti,tca6416";
164		reg = <0x20>;
165		gpio-controller;
166		#gpio-cells = <2>;
167		vcc-supply = <&vdd_io_reg>;
168	};
169
170	tca6416_3: gpio@21 {
171		compatible = "ti,tca6416";
172		reg = <0x21>;
173		gpio-controller;
174		#gpio-cells = <2>;
175		vcc-supply = <&vdd_io_reg>;
176	};
177
178	/* TVP5146 Analog Video decoder input */
179	tvp5146@5c {
180		compatible = "ti,tvp5146m2";
181		reg = <0x5c>;
182	};
183};
184
185&mcbsp1 {
186	status = "okay";
187	#sound-dai-cells = <0>;
188	pinctrl-names = "default";
189	pinctrl-0 = <&mcbsp1_pins>;
190};
191
192&mcbsp2 {
193	status = "okay";
194	#sound-dai-cells = <0>;
195	pinctrl-names = "default";
196	pinctrl-0 = <&mcbsp2_pins>;
197};
198
199&omap3_pmx_core {
200	mcbsp1_pins: mcbsp1-pins {
201		pinctrl-single,pins = <
202			OMAP3_CORE1_IOPAD(0x2190, PIN_OUTPUT | MUX_MODE0)	/* mcbsp1_dx.mcbsp1_dx */
203			OMAP3_CORE1_IOPAD(0x2192, PIN_INPUT | MUX_MODE0)	/* mcbsp1_dx.mcbsp1_dr */
204			OMAP3_CORE1_IOPAD(0x2196, PIN_INPUT | MUX_MODE0)	/* mcbsp_clks.mcbsp1_fsx */
205			OMAP3_CORE1_IOPAD(0x2198, PIN_INPUT | MUX_MODE0)	/* mcbsp1_clkx.mcbsp1_clkx */
206		>;
207	};
208
209	mcbsp2_pins: mcbsp2-pins {
210		pinctrl-single,pins = <
211			OMAP3_CORE1_IOPAD(0x213c, PIN_INPUT | MUX_MODE0)	/* mcbsp2_fsx.mcbsp2_fsx */
212			OMAP3_CORE1_IOPAD(0x213e, PIN_INPUT | MUX_MODE0)	/* mcbsp2_clkx.mcbsp2_clkx */
213			OMAP3_CORE1_IOPAD(0x2140, PIN_INPUT | MUX_MODE0)	/* mcbsp2_dr.mcbsp2.dr */
214			OMAP3_CORE1_IOPAD(0x2142, PIN_OUTPUT | MUX_MODE0)	/* mcbsp2_dx.mcbsp2_dx */
215		>;
216	};
217};
218