Skip to content

Commit f41010d

Browse files
brentlulgirdwood
authored andcommitted
topology: sof-adl-max98360a-rt5682-2way: add new topology
Add support for four max98360a speaker amplifiers running in TDM mode which format is 8 slots with 32 bit slot/sample width on ADL boards. To implement the 2-way woofer/tweeter speaker function in SOF, there is a demux to create 4-channel audio data with EQ on each channel for band-split function. Signed-off-by: Brent Lu <brent.lu@intel.com>
1 parent e2bb260 commit f41010d

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

tools/topology/topology1/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ set(TPLGS
136136
"sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DAMP_SSP=2"
137137
"sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR"
138138
"sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DAMP_SSP=1"
139+
"sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DAMP_SSP=1\;-D2_WAY_SPK"
139140
"sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DAMP_SSP=1"
140141
"sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DAMP_SSP=1\;-DDRC_EQ"
141142
"sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DAMP_SSP=1"

tools/topology/topology1/sof-tgl-max98357a-rt5682.m4

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,20 @@ define(matrix2, `ROUTE_MATRIX(9,
5151
`BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)',
5252
`BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')')
5353

54+
define(matrix3, `ROUTE_MATRIX(1,
55+
`BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)',
56+
`BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)',
57+
`BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)',
58+
`BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)',
59+
`BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)',
60+
`BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)',
61+
`BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)',
62+
`BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)')')
63+
5464
dnl name, num_streams, route_matrix list
55-
MUXDEMUX_CONFIG(demux_priv_1, 2, LIST(` ', `matrix1,', `matrix2'))
65+
ifdef(`2_WAY_SPK',
66+
`MUXDEMUX_CONFIG(demux_priv_1, 1, LIST(`` '', `matrix3'))',
67+
`MUXDEMUX_CONFIG(demux_priv_1, 2, LIST(`` '', `matrix1,', `matrix2'))')
5668

5769
#
5870
# Define the pipelines
@@ -120,7 +132,8 @@ define(`ENDPOINT_NAME', `Speakers')
120132
PIPELINE_PCM_ADD(
121133
ifdef(`WAVES', sof/pipe-waves-codec-demux-playback.m4,
122134
ifdef(`DRC_EQ', sof/pipe-drc-eq-volume-demux-playback.m4,
123-
sof/pipe-volume-demux-playback.m4)),
135+
ifdef(`2_WAY_SPK', sof/pipe-demux-eq-iir-playback.m4,
136+
sof/pipe-volume-demux-playback.m4))),
124137
1, 0, 2, s32le,
125138
1000, 0, 0,
126139
48000, 48000, 48000)
@@ -202,7 +215,8 @@ DAI_ADD(sof/pipe-dai-capture.m4,
202215
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
203216
',
204217
`
205-
# currently this dai is here as "virtual" capture backend
218+
ifdef(`2_WAY_SPK',`# No echo reference for 2-way speakers',
219+
`# currently this dai is here as "virtual" capture backend
206220
W_DAI_IN(SSP, SPK_SSP_INDEX, SPK_SSP_NAME, FMT, 3, 0)
207221

208222
# Capture pipeline 9 from demux on PCM 6 using max 2 channels of s32le.
@@ -232,7 +246,7 @@ SectionGraph."PIPE_CAP_VIRT" {
232246
dapm(ECHO REF 9, SPK_REF_DAI_NAME)
233247
]
234248
}
235-
')
249+
')')
236250

237251
# playback DAI is SSP0 using 2 periods
238252
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
@@ -284,7 +298,8 @@ PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_5)
284298
PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_6)
285299
PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_7)
286300
PCM_PLAYBACK_ADD(HDMI4, 5, PIPELINE_PCM_8)
287-
PCM_CAPTURE_ADD(EchoRef, 6, PIPELINE_PCM_9)
301+
ifdef(`2_WAY_SPK',`# No echo reference for 2-way speakers',
302+
`PCM_CAPTURE_ADD(EchoRef, 6, PIPELINE_PCM_9)')
288303

289304
#
290305
# BE conf2igurations - overrides config in ACPI if present
@@ -311,6 +326,12 @@ ifelse(
311326
SSP_CLOCK(fsync, 48000, codec_slave),
312327
SSP_TDM(2, 32, 3, 3),
313328
SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))',
329+
CODEC, `MAX98360A_TDM', `
330+
SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in),
331+
SSP_CLOCK(bclk, 12288000, codec_slave),
332+
SSP_CLOCK(fsync, 48000, codec_slave),
333+
SSP_TDM(8, 32, 15, 15),
334+
SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))',
314335
CODEC, `RT1011', `
315336
SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in),
316337
SSP_CLOCK(bclk, 4800000, codec_slave),

0 commit comments

Comments
 (0)