Skip to content

Commit 0510953

Browse files
committed
topology1: add support for rt1308 ssp amp + HDMI-in capture.
Adding support for rt1308 ssp amplifier and HDMI-in capture via I2S. Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
1 parent ee31854 commit 0510953

2 files changed

Lines changed: 222 additions & 0 deletions

File tree

tools/topology/topology1/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ set(TPLGS
151151
#sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's.
152152
"sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2"
153153

154+
#To support HDMI-in capture with RT1308 ssp-amplifier products.
155+
"sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl"
156+
154157
## i.MX8 (i.MX8QM and i.MX8QXP) topologies
155158
"sof-imx8-nocodec\;sof-imx8-nocodec"
156159
"sof-imx8-wm8960-cs42888\;sof-imx8-wm8960-cs42888"
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
#
2+
# Topology for Tigerlake with rt1308 codec + DMIC + 3 HDMI out + 2 HDMI-in capture
3+
#
4+
5+
# Include topology builder
6+
include(`utils.m4')
7+
include(`dai.m4')
8+
include(`pipeline.m4')
9+
include(`ssp.m4')
10+
include(`hda.m4')
11+
12+
# Include TLV library
13+
include(`common/tlv.m4')
14+
15+
# Include Token library
16+
include(`sof/tokens.m4')
17+
18+
# Include Tigerlake DSP configuration
19+
include(`platform/intel/'PLATFORM`.m4')
20+
include(`platform/intel/dmic.m4')
21+
22+
define(`HDMI1_SSP_NAME', concat(concat(`SSP', HDMI_1_SSP_NUM),`-HDMI'))
23+
define(`HDMI2_SSP_NAME', concat(concat(`SSP', HDMI_2_SSP_NUM),`-HDMI'))
24+
define(`AMP_SSP_NAME', concat(concat(`SSP', AMP_SSP_NUM),`-Codec'))
25+
26+
ifdef(`NO_AMP',`',`
27+
ifdef(`AMP_SSP_NUM',`',`fatal_error(note: Define AMP_SSP_NUM for speaker amp SSP)')')
28+
29+
DEBUG_START
30+
#
31+
# Define the pipelines
32+
#
33+
# PCM0 <---- volume <----- HDMI-1 SSP
34+
# PCM1 <---- volume <----- HDMI-2 SSP
35+
# PCM2 ----> volume -----> Codec SSP
36+
# PCM3 <---- volume <----- DMIC01 (dmic0 capture)
37+
#
38+
39+
# PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5)
40+
# PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6)
41+
# PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7)
42+
43+
44+
dnl PIPELINE_PCM_ADD(pipeline,
45+
dnl pipe id, pcm, max channels, format,
46+
dnl frames, deadline, priority, core)
47+
48+
# Low Latency capture pipeline 1 on PCM 0 using max 2 channels of s16le.
49+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
50+
PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
51+
1, 0, 2, s32le,
52+
1000, 0, 0,
53+
48000, 48000, 48000)
54+
55+
56+
# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s16le.
57+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
58+
PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
59+
2, 1, 2, s32le,
60+
1000, 0, 0,
61+
48000, 48000, 48000)
62+
63+
ifdef(`NO_AMP',`',`
64+
# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s24le.
65+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
66+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
67+
3, 2, 2, s24le,
68+
1000, 0, 0,
69+
48000, 48000, 48000)')
70+
71+
# Passthrough capture pipeline 4 on PCM 3 using max 4 channels.
72+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
73+
PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
74+
4, 3, 4, s32le,
75+
1000, 0, 0,
76+
48000, 48000, 48000)
77+
78+
# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s24le.
79+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
80+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
81+
5, 5, 2, s32le,
82+
1000, 0, 0,
83+
48000, 48000, 48000)
84+
85+
# Low Latency playback pipeline 6 on PCM 6 using max 2 channels of s24le.
86+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
87+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
88+
6, 6, 2, s32le,
89+
1000, 0, 0,
90+
48000, 48000, 48000)
91+
92+
# Low Latency playback pipeline 7 on PCM 7 using max 2 channels of s24le.
93+
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
94+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
95+
7, 7, 2, s32le,
96+
1000, 0, 0,
97+
48000, 48000, 48000)
98+
99+
#
100+
# DAIs configuration
101+
#
102+
103+
dnl DAI_ADD(pipeline,
104+
dnl pipe id, dai type, dai_index, dai_be,
105+
dnl buffer, periods, format,
106+
dnl frames, deadline, priority, core)
107+
108+
# capture DAI using 2 periods
109+
# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
110+
DAI_ADD(sof/pipe-dai-capture.m4,
111+
1, SSP, HDMI_1_SSP_NUM, HDMI1_SSP_NAME,
112+
PIPELINE_SINK_1, 2, s32le,
113+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
114+
115+
# capture DAI using 2 periods
116+
# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
117+
DAI_ADD(sof/pipe-dai-capture.m4,
118+
2, SSP, HDMI_2_SSP_NUM, HDMI2_SSP_NAME,
119+
PIPELINE_SINK_2, 2, s32le,
120+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
121+
122+
ifdef(`NO_AMP',`',`
123+
# playback DAI using 2 periods
124+
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
125+
DAI_ADD(sof/pipe-dai-playback.m4,
126+
3, SSP, AMP_SSP_NUM, AMP_SSP_NAME,
127+
PIPELINE_SOURCE_3, 2, s24le,
128+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)')
129+
130+
# capture DAI is DMIC01 using 2 periods
131+
# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0
132+
DAI_ADD(sof/pipe-dai-capture.m4,
133+
4, DMIC, 0, dmic01,
134+
PIPELINE_SINK_4, 2, s32le,
135+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
136+
137+
# playback DAI is iDisp1 using 2 periods
138+
# Buffers use s32le format, 1000us deadline with priority 0 on core 0
139+
DAI_ADD(sof/pipe-dai-playback.m4,
140+
5, HDA, 5, iDisp1,
141+
PIPELINE_SOURCE_5, 2, s32le,
142+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
143+
144+
# playback DAI is iDisp2 using 2 periods
145+
# Buffers use s32le format, 1000us deadline with priority 0 on core 0
146+
DAI_ADD(sof/pipe-dai-playback.m4,
147+
6, HDA, 6, iDisp2,
148+
PIPELINE_SOURCE_6, 2, s32le,
149+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
150+
151+
# playback DAI is iDisp3 using 2 periods
152+
# Buffers use s32le format, 1000us deadline with priority 0 on core 0
153+
DAI_ADD(sof/pipe-dai-playback.m4,
154+
7, HDA, 7, iDisp3,
155+
PIPELINE_SOURCE_7, 2, s32le,
156+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
157+
158+
# PCM Low Latency, id 0
159+
dnl PCM_CAPTURE_ADD(name, pcm_id, capture)
160+
PCM_CAPTURE_ADD(HDMI-IN-1, 0, PIPELINE_PCM_1)
161+
162+
dnl PCM_CAPTURE_ADD(name, pcm_id, capture)
163+
PCM_CAPTURE_ADD(HDMI-IN-2, 1, PIPELINE_PCM_2)
164+
165+
ifdef(`NO_AMP',`',`
166+
dnl PCM_PLAYBACK_ADD(name, pcm_id, playback)
167+
PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3)')
168+
PCM_CAPTURE_ADD(DMIC01, 3, PIPELINE_PCM_4)
169+
170+
PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_5)
171+
PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_6)
172+
PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_7)
173+
174+
#
175+
# BE configurations - overrides config in ACPI if present
176+
#
177+
178+
#HDMI-1 SSP (ID: 0)
179+
#MCLK is not required and won't impact for HDMI-in capture use case.
180+
DAI_CONFIG(SSP, HDMI_1_SSP_NUM, 0, HDMI1_SSP_NAME,
181+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in),
182+
SSP_CLOCK(bclk, 3072000, codec_master),
183+
SSP_CLOCK(fsync, 48000, codec_master),
184+
SSP_TDM(2, 32, 3, 3),
185+
SSP_CONFIG_DATA(SSP, HDMI_1_SSP_NUM, 32, 0)))
186+
187+
#HDMI-2 SSP (ID: 1)
188+
#MCLK is not required and won't impact for HDMI-in capture use case.
189+
DAI_CONFIG(SSP, HDMI_2_SSP_NUM, 1, HDMI2_SSP_NAME,
190+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in),
191+
SSP_CLOCK(bclk, 3072000, codec_master),
192+
SSP_CLOCK(fsync, 48000, codec_master),
193+
SSP_TDM(2, 32, 3, 3),
194+
SSP_CONFIG_DATA(SSP, HDMI_2_SSP_NUM, 32, 0)))
195+
196+
ifdef(`NO_AMP',`',`
197+
#Amplifier Codec SSP (ID: 2)
198+
DAI_CONFIG(SSP, AMP_SSP_NUM, 2, AMP_SSP_NAME,
199+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in),
200+
SSP_CLOCK(bclk, 2400000, codec_slave),
201+
SSP_CLOCK(fsync, 48000, codec_slave),
202+
SSP_TDM(2, 25, 3, 3),
203+
SSP_CONFIG_DATA(SSP, AMP_SSP_NUM, 24)))')
204+
205+
# dmic01 (ID: 3)
206+
DAI_CONFIG(DMIC, 0, 3, dmic01,
207+
DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000,
208+
DMIC_WORD_LENGTH(s32le), 400, DMIC, 0,
209+
PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))
210+
211+
212+
# 3 HDMI/DP outputs (ID: 5,6,7)
213+
DAI_CONFIG(HDA, 5, 5, iDisp1,
214+
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2)))
215+
DAI_CONFIG(HDA, 6, 6, iDisp2,
216+
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2)))
217+
DAI_CONFIG(HDA, 7, 7, iDisp3,
218+
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 7, 48000, 2)))
219+
DEBUG_END

0 commit comments

Comments
 (0)