topology: imx: Add topology file for i.MX8QM with wm8962 codec

Add new topology file for i.MX8QM with wm8962 codec.

While here, use CODEC variable to differentiate between wm8960
and wm8962.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
This commit is contained in:
Iuliana Prodan 2023-04-06 16:29:23 +03:00 committed by Pierre-Louis Bossart
parent 0b1d10b099
commit 6687c298f2
2 changed files with 21 additions and 9 deletions

View File

@ -156,10 +156,11 @@ set(TPLGS
"sof-imx8-compr-wm8960-mixer\;sof-imx8-compr-wm8960-mixer" "sof-imx8-compr-wm8960-mixer\;sof-imx8-compr-wm8960-mixer"
"sof-imx8-wm8960-kwd\;sof-imx8-wm8960-kwd" "sof-imx8-wm8960-kwd\;sof-imx8-wm8960-kwd"
"sof-imx8-cs42888-mixer\;sof-imx8-cs42888-mixer" "sof-imx8-cs42888-mixer\;sof-imx8-cs42888-mixer"
"sof-imx8-wm8960\;sof-imx8-wm8960\;-DPPROC=volume" "sof-imx8-wm8960\;sof-imx8-wm8960\;-DCODEC=wm8960\;-DPPROC=volume"
"sof-imx8-wm8960\;sof-imx8-eq-iir-wm8960\;-DPPROC=eq-iir-volume" "sof-imx8-wm8960\;sof-imx8-wm8962\;-DCODEC=wm8962\;-DPPROC=volume"
"sof-imx8-wm8960\;sof-imx8-eq-fir-wm8960\;-DPPROC=eq-fir-volume" "sof-imx8-wm8960\;sof-imx8-eq-iir-wm8960\;-DCODEC=wm8960\;-DPPROC=eq-iir-volume"
"sof-imx8-wm8960\;sof-imx8-drc-wm8960\;-DPPROC=drc" "sof-imx8-wm8960\;sof-imx8-eq-fir-wm8960\;-DCODEC=wm8960\;-DPPROC=eq-fir-volume"
"sof-imx8-wm8960\;sof-imx8-drc-wm8960\;-DCODEC=wm8960\;-DPPROC=drc"
## end i.MX8 (i.MX8QM and i.MX8QXP) topologies ## end i.MX8 (i.MX8QM and i.MX8QXP) topologies
## i.MX8MP topologies ## i.MX8MP topologies

View File

@ -1,5 +1,7 @@
# #
# Topology for i.MX8QXP board with wm8960 codec # Topology for i.MX8QM/i.MX8QXP board with 'CODEC' codec
#
# CODEC: wm8960, wm8962
# #
# Include topology builder # Include topology builder
@ -22,7 +24,7 @@ include(`platform/imx/imx8.m4')
# #
# Define the pipelines # Define the pipelines
# #
# PCM0 <----> volume <-----> SAI1 (wm8960) # PCM0 <----> volume <-----> SAI1 (CODEC)
# #
dnl PIPELINE_PCM_ADD(pipeline, dnl PIPELINE_PCM_ADD(pipeline,
@ -48,6 +50,15 @@ PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
# DAIs configuration # DAIs configuration
# #
# define STREAM_NAME, based on CODEC name
define(`STREAM_NAME',
`ifelse(CODEC, `wm8960', `wm8960-hifi',
CODEC, `wm8962', `wm8962',
`fatal_error(`Codec not supported.')')')
# define DAI BE dai_link name
define(`DAI_BE_NAME', concat(`sai1-', STREAM_NAME))
dnl DAI_ADD(pipeline, dnl DAI_ADD(pipeline,
dnl pipe id, dai type, dai_index, dai_be, dnl pipe id, dai type, dai_index, dai_be,
dnl buffer, periods, format, dnl buffer, periods, format,
@ -56,14 +67,14 @@ dnl period, priority, core, time_domain)
# playback DAI is SAI1 using 2 periods # playback DAI is SAI1 using 2 periods
# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0
DAI_ADD(sof/pipe-dai-playback.m4, DAI_ADD(sof/pipe-dai-playback.m4,
1, SAI, 1, sai1-wm8960-hifi, 1, SAI, 1, DAI_BE_NAME,
PIPELINE_SOURCE_1, 2, s32le, PIPELINE_SOURCE_1, 2, s32le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
# capture DAI is SAI1 using 2 periods # capture DAI is SAI1 using 2 periods
# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0
DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-capture.m4,
2, SAI, 1, sai1-wm8960-hifi, 2, SAI, 1, DAI_BE_NAME,
PIPELINE_SINK_2, 2, s32le, PIPELINE_SINK_2, 2, s32le,
1000, 0, 0) 1000, 0, 0)
@ -74,7 +85,7 @@ dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture)
PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
dnl DAI_CONFIG(type, idx, link_id, name, sai_config) dnl DAI_CONFIG(type, idx, link_id, name, sai_config)
DAI_CONFIG(SAI, 1, 0, sai1-wm8960-hifi, DAI_CONFIG(SAI, 1, 0, DAI_BE_NAME,
SAI_CONFIG(I2S, SAI_CLOCK(mclk, 12288000, codec_mclk_in), SAI_CONFIG(I2S, SAI_CLOCK(mclk, 12288000, codec_mclk_in),
SAI_CLOCK(bclk, 3072000, codec_master), SAI_CLOCK(bclk, 3072000, codec_master),
SAI_CLOCK(fsync, 48000, codec_master), SAI_CLOCK(fsync, 48000, codec_master),