Skip to content

Commit 30213ef

Browse files
committed
topology: add hda generic kwd pipeline
Add KWD pipeline with kfpm only for HDA generic topology. DMIC 48K have PCM 6 DMIC 16K have PCM 7 Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
1 parent 48c41fa commit 30213ef

File tree

2 files changed

+199
-0
lines changed

2 files changed

+199
-0
lines changed

tools/topology/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ set(TPLGS
2828
"sof-hda-generic\;sof-hda-generic-4ch\;-DCHANNELS=4\;-DPPROC=volume"
2929
"sof-hda-generic\;sof-hda-generic-eq-2ch\;-DCHANNELS=2\;-DPPROC=eq-volume"
3030
"sof-hda-generic\;sof-hda-generic-eq-4ch\;-DCHANNELS=4\;-DPPROC=eq-volume"
31+
"sof-hda-generic-kwd\;sof-hda-generic-2ch-kwd\;-DCHANNELS=2"
32+
"sof-hda-generic-kwd\;sof-hda-generic-4ch-kwd\;-DCHANNELS=4"
3133
"sof-hda-generic-idisp\;sof-hda-generic-idisp\;-DCHANNELS=0"
3234
"sof-hda-generic-idisp\;sof-hda-generic-idisp-2ch\;-DCHANNELS=2"
3335
"sof-hda-generic-idisp\;sof-hda-generic-idisp-4ch\;-DCHANNELS=4"
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Topology for SKL+ HDA Generic machine
2+
#
3+
4+
# Include topology builder
5+
include(`utils.m4')
6+
include(`dai.m4')
7+
include(`pipeline.m4')
8+
9+
# Include TLV library
10+
include(`common/tlv.m4')
11+
12+
# Include Token library
13+
include(`sof/tokens.m4')
14+
15+
# Include bxt DSP configuration
16+
include(`platform/intel/bxt.m4')
17+
18+
19+
20+
21+
22+
#
23+
# Define the pipelines
24+
#
25+
# PCM0 <---> volume (pipe 1,2) <----> HDA Analog (HDA Analog playback/capture)
26+
# PCM1 <---> volume (pipe 3,4) <----> HDA Digital (HDA Digital playback/capture)
27+
# PCM3 ----> volume (pipe 7) -----> iDisp1 (HDMI/DP playback, BE link 3)
28+
# PCM4 ----> Volume (pipe 8) -----> iDisp2 (HDMI/DP playback, BE link 4)
29+
# PCM5 ----> volume (pipe 9) -----> iDisp3 (HDMI/DP playback, BE link 5)
30+
# PCM6 <---- Volume (pipe 10) <----- DMIC01
31+
# PCM7 <---- KWD (pipe 11/12) <----- DMIC16K (KWD)
32+
#
33+
34+
# Define pipeline id for intel-generic-dmic-kwd.m4
35+
# to generate dmic setting with kwd when we have dmic
36+
# define kfbm without volume
37+
# define pcm to 6,7, pipeline to 10,11,12 and dai id to 6,7
38+
ifelse(CHANNELS, `0', ,
39+
`
40+
define(KFBM_TYPE, `kfbm')
41+
define(DMIC_PCM_48k_ID, `6')
42+
define(DMIC_PCM_16k_ID, `7')
43+
define(DMIC_PIPELINE_48k_ID, `10')
44+
define(DMIC_PIPELINE_16k_ID, `11')
45+
define(DMIC_PIPELINE_KWD_ID, `12')
46+
define(DMIC_DAI_LINK_48k_ID, `6')
47+
define(DMIC_DAI_LINK_16k_ID, `7')
48+
define(KWD_PIPE_SCH_DEADLINE_US, 20000)
49+
50+
include(`platform/intel/intel-generic-dmic-kwd.m4')
51+
'
52+
)
53+
54+
# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le.
55+
# 1000us deadline on core 0 with priority 0
56+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
57+
1, 0, 2, s24le,
58+
1000, 0, 0,
59+
48000, 48000, 48000)
60+
61+
# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le.
62+
# 1000us deadline on core 0 with priority 0
63+
PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
64+
2, 0, 2, s24le,
65+
1000, 0, 0,
66+
48000, 48000, 48000)
67+
68+
# Low Latency playback pipeline 3 on PCM 1 using max 2 channels of s24le.
69+
# 1000us deadline on core 0 with priority 0
70+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
71+
3, 1, 2, s24le,
72+
1000, 0, 0,
73+
48000, 48000, 48000)
74+
75+
# Low Latency capture pipeline 4 on PCM 1 using max 2 channels of s24le.
76+
# 1000us deadline on core 0 with priority 0
77+
PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
78+
4, 1, 2, s24le,
79+
1000, 0, 0,
80+
48000, 48000, 48000)
81+
82+
# Low Latency playback pipeline 7 on PCM 3 using max 2 channels of s24le.
83+
# 1000us deadline on core 0 with priority 0
84+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
85+
7, 3, 2, s24le,
86+
1000, 0, 0,
87+
48000, 48000, 48000)
88+
89+
# Low Latency playback pipeline 8 on PCM 4 using max 2 channels of s24le.
90+
# 1000us deadline on core 0 with priority 0
91+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
92+
8, 4, 2, s24le,
93+
1000, 0, 0,
94+
48000, 48000, 48000)
95+
96+
# Low Latency playback pipeline 9 on PCM 5 using max 2 channels of s24le.
97+
# 1000us deadline on core 0 with priority 0
98+
PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
99+
9, 5, 2, s24le,
100+
1000, 0, 0,
101+
48000, 48000, 48000)
102+
103+
#
104+
# DAIs configuration
105+
#
106+
107+
# playback DAI is HDA Analog using 2 periods
108+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
109+
DAI_ADD(sof/pipe-dai-playback.m4,
110+
1, HDA, 0, Analog Playback and Capture,
111+
PIPELINE_SOURCE_1, 2, s32le,
112+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
113+
114+
# capture DAI is HDA Analog using 2 periods
115+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
116+
DAI_ADD(sof/pipe-dai-capture.m4,
117+
2, HDA, 1, Analog Playback and Capture,
118+
PIPELINE_SINK_2, 2, s32le,
119+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
120+
121+
# playback DAI is HDA Digital using 2 periods
122+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
123+
DAI_ADD(sof/pipe-dai-playback.m4,
124+
3, HDA, 2, Digital Playback and Capture,
125+
PIPELINE_SOURCE_3, 2, s32le,
126+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
127+
128+
# capture DAI is HDA Digital using 2 periods
129+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
130+
DAI_ADD(sof/pipe-dai-capture.m4,
131+
4, HDA, 3, Digital Playback and Capture,
132+
PIPELINE_SINK_4, 2, s32le,
133+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
134+
135+
# playback DAI is iDisp1 using 2 periods
136+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
137+
DAI_ADD(sof/pipe-dai-playback.m4,
138+
7, HDA, 4, iDisp1,
139+
PIPELINE_SOURCE_7, 2, s32le,
140+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
141+
142+
# playback DAI is iDisp2 using 2 periods
143+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
144+
DAI_ADD(sof/pipe-dai-playback.m4,
145+
8, HDA, 5, iDisp2,
146+
PIPELINE_SOURCE_8, 2, s32le,
147+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
148+
149+
# playback DAI is iDisp3 using 2 periods
150+
# Dai buffers use s32le format, 1000us deadline on core 0 with priority 0
151+
DAI_ADD(sof/pipe-dai-playback.m4,
152+
9, HDA, 6, iDisp3,
153+
PIPELINE_SOURCE_9, 2, s32le,
154+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
155+
156+
PCM_DUPLEX_ADD(HDA Analog, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
157+
PCM_DUPLEX_ADD(HDA Digital, 1, PIPELINE_PCM_3, PIPELINE_PCM_4)
158+
PCM_PLAYBACK_ADD(HDMI1, 3, PIPELINE_PCM_7)
159+
PCM_PLAYBACK_ADD(HDMI2, 4, PIPELINE_PCM_8)
160+
PCM_PLAYBACK_ADD(HDMI3, 5, PIPELINE_PCM_9)
161+
162+
#
163+
# BE configurations - overrides config in ACPI if present
164+
#
165+
166+
# HDA outputs
167+
DAI_CONFIG(HDA, 0, 4, Analog Playback and Capture)
168+
DAI_CONFIG(HDA, 1, 5, Digital Playback and Capture)
169+
# 3 HDMI/DP outputs (ID: 3,4,5)
170+
DAI_CONFIG(HDA, 4, 1, iDisp1)
171+
DAI_CONFIG(HDA, 5, 2, iDisp2)
172+
DAI_CONFIG(HDA, 6, 3, iDisp3)
173+
174+
175+
VIRTUAL_DAPM_ROUTE_IN(codec0_in, HDA, 1, IN, 1)
176+
VIRTUAL_DAPM_ROUTE_IN(codec1_in, HDA, 3, IN, 2)
177+
VIRTUAL_DAPM_ROUTE_OUT(codec0_out, HDA, 0, OUT, 3)
178+
VIRTUAL_DAPM_ROUTE_OUT(codec1_out, HDA, 2, OUT, 4)
179+
180+
# codec2 is not supported in dai links but it exists
181+
# in dapm routes, so hack this one to HDA1
182+
VIRTUAL_DAPM_ROUTE_IN(codec2_in, HDA, 3, IN, 5)
183+
VIRTUAL_DAPM_ROUTE_OUT(codec2_out, HDA, 2, OUT, 6)
184+
185+
VIRTUAL_DAPM_ROUTE_OUT(iDisp1_out, HDA, 4, OUT, 7)
186+
VIRTUAL_DAPM_ROUTE_OUT(iDisp2_out, HDA, 5, OUT, 8)
187+
VIRTUAL_DAPM_ROUTE_OUT(iDisp3_out, HDA, 6, OUT, 9)
188+
189+
VIRTUAL_WIDGET(iDisp3 Tx, out_drv, 0)
190+
VIRTUAL_WIDGET(iDisp2 Tx, out_drv, 1)
191+
VIRTUAL_WIDGET(iDisp1 Tx, out_drv, 2)
192+
VIRTUAL_WIDGET(Analog CPU Playback, out_drv, 3)
193+
VIRTUAL_WIDGET(Digital CPU Playback, out_drv, 4)
194+
VIRTUAL_WIDGET(Alt Analog CPU Playback, out_drv, 5)
195+
VIRTUAL_WIDGET(Analog CPU Capture, input, 6)
196+
VIRTUAL_WIDGET(Digital CPU Capture, input, 7)
197+
VIRTUAL_WIDGET(Alt Analog CPU Capture, input, 8)

0 commit comments

Comments
 (0)