1#
2# Topology for Cometlake with rt5682 codec.
3#
4
5# Include topology builder
6include(`utils.m4')
7include(`dai.m4')
8include(`pipeline.m4')
9include(`ssp.m4')
10include(`hda.m4')
11
12# Include TLV library
13include(`common/tlv.m4')
14
15# Include Token library
16include(`sof/tokens.m4')
17
18# Include Cometlake DSP configuration
19include(`platform/intel/cml.m4')
20
21DEBUG_START
22
23#
24# Define the pipelines
25#
26# PCM0 ----> SRC ----> volume -----> SSP1
27# PCM0 <---- volume <----- SSP1
28# PCM1 <---- volume <----- DMIC01 (dmic0 capture)
29# PCM2 ----> volume -----> iDisp1
30# PCM3 ----> volume -----> iDisp2
31# PCM4 ----> volume -----> iDisp3
32#
33
34dnl PIPELINE_PCM_ADD(pipeline,
35dnl     pipe id, pcm, max channels, format,
36dnl     period, priority, core,
37dnl     pcm_min_rate, pcm_max_rate, pipeline_rate,
38dnl     time_domain, sched_comp)
39
40# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le.
41# Set 1000us deadline on core 0 with priority 0
42PIPELINE_PCM_ADD(sof/pipe-src-volume-playback.m4,
43	1, 0, 2, s24le,
44	1000, 0, 0,
45	8000, 96000, 48000)
46
47# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le.
48# Set 1000us deadline on core 0 with priority 0
49PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
50	2, 0, 2, s24le,
51	1000, 0, 0,
52	48000, 48000, 48000)
53
54# Passthrough capture pipeline 3 on PCM 1 using max 4 channels.
55# Set 1000us deadline on core 0 with priority 0
56PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
57	3, 1, 4, s32le,
58	1000, 0, 0,
59	48000, 48000, 48000)
60
61# Low Latency playback pipeline 4 on PCM 2 using max 2 channels of s32le.
62# Set 1000us deadline on core 0 with priority 0
63PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
64	4, 2, 2, s32le,
65	1000, 0, 0,
66	48000, 48000, 48000)
67
68# Low Latency playback pipeline 5 on PCM 3 using max 2 channels of s32le.
69# Set 1000us deadline on core 0 with priority 0
70PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
71	5, 3, 2, s32le,
72	1000, 0, 0,
73	48000 ,48000 ,48000)
74
75# Low Latency playback pipeline 6 on PCM 4 using max 2 channels of s32le.
76# Set 1000us deadline on core 0 with priority 0
77PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
78	6, 4, 2, s32le,
79	1000, 0, 0,
80	48000, 48000, 48000)
81
82#
83# DAIs configuration
84#
85
86dnl DAI_ADD(pipeline,
87dnl     pipe id, dai type, dai_index, dai_be,
88dnl     buffer, periods, format,
89dnl     deadline, priority, core, time_domain)
90
91# playback DAI is SSP1 using 2 periods
92# Buffers use s24le format, 1000us deadline on core 0 with priority 0
93DAI_ADD(sof/pipe-dai-playback.m4,
94	1, SSP, 1, SSP1-Codec,
95	PIPELINE_SOURCE_1, 2, s24le,
96	1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
97
98# capture DAI is SSP1 using 2 periods
99# Buffers use s24le format, 1000us deadline on core 0 with priority 0
100DAI_ADD(sof/pipe-dai-capture.m4,
101	2, SSP, 1, SSP1-Codec,
102	PIPELINE_SINK_2, 2, s24le,
103	1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
104
105# capture DAI is DMIC01 using 2 periods
106# Buffers use s32le format, 1000us deadline on core 0 with priority 0
107DAI_ADD(sof/pipe-dai-capture.m4,
108	3, DMIC, 0, dmic01,
109	PIPELINE_SINK_3, 2, s32le,
110	1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
111
112# playback DAI is iDisp1 using 2 periods
113# Buffers use s32le format, 1000us deadline on core 0 with priority 0
114DAI_ADD(sof/pipe-dai-playback.m4,
115	4, HDA, 0, iDisp1,
116	PIPELINE_SOURCE_4, 2, s32le,
117	1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
118
119# playback DAI is iDisp2 using 2 periods
120# Buffers use s32le format, 1000us deadline on core 0 with priority 0
121DAI_ADD(sof/pipe-dai-playback.m4,
122	5, HDA, 1, iDisp2,
123	PIPELINE_SOURCE_5, 2, s32le,
124	1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
125
126# playback DAI is iDisp3 using 2 periods
127# Buffers use s32le format, 1000us deadline on core 0 with priority 0
128DAI_ADD(sof/pipe-dai-playback.m4,
129	6, HDA, 2, iDisp3,
130	PIPELINE_SOURCE_6, 2, s32le,
131	1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
132
133# PCM Low Latency, id 0
134dnl PCM_PLAYBACK_ADD(name, pcm_id, playback)
135PCM_DUPLEX_ADD(Port1, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
136PCM_CAPTURE_ADD(DMIC, 1, PIPELINE_PCM_3)
137PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_4)
138PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_5)
139PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_6)
140
141#
142# BE configurations - overrides config in ACPI if present
143#
144
145#SSP 1 (ID: 0)
146DAI_CONFIG(SSP, 1, 0, SSP1-Codec,
147	SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in),
148		      SSP_CLOCK(bclk, 2400000, codec_slave),
149		      SSP_CLOCK(fsync, 48000, codec_slave),
150		      SSP_TDM(2, 25, 3, 3),
151		      SSP_CONFIG_DATA(SSP, 1, 24)))
152
153# dmic01 (ID: 1)
154DAI_CONFIG(DMIC, 0, 1, dmic01,
155	   DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000,
156		DMIC_WORD_LENGTH(s32le), 400, DMIC, 0,
157		PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))
158
159# 3 HDMI/DP outputs (ID: 2,3,4)
160DAI_CONFIG(HDA, 0, 2, iDisp1,
161	HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
162DAI_CONFIG(HDA, 1, 3, iDisp2,
163	HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
164DAI_CONFIG(HDA, 2, 4, iDisp3,
165	HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))
166
167
168DEBUG_END
169