From 252e7e75593cb5aa5f09d84aee607d31f3afd682 Mon Sep 17 00:00:00 2001 From: MARUTHI MACHANI Date: Wed, 19 Oct 2022 12:29:14 +0530 Subject: [PATCH] topology1: support for dmic with 4 channels Topology support to configure dmic with four channels for amd platforms. Signed-off-by: MARUTHI MACHANI --- tools/topology/topology1/CMakeLists.txt | 1 + .../topology/topology1/sof-acp-rmb-dmic4ch.m4 | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tools/topology/topology1/sof-acp-rmb-dmic4ch.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 57b5b8556..59aad772d 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -292,6 +292,7 @@ set(TPLGS "sof-rn-rt5682-rt1019\;sof-rn-rt5682-rt1019-dts\;-DDTS=`DTS'" "sof-rn-rt5682-max98360\;sof-rn-rt5682-max98360" "sof-acp-rmb\;sof-acp-rmb" + "sof-acp-rmb-dmic4ch\;sof-acp-rmb-dmic4ch" "sof-acp-rmb\;sof-rmb-rt5682s-rt1019" "sof-acp-rmb\;sof-rmb-nau8825-max9860" ) diff --git a/tools/topology/topology1/sof-acp-rmb-dmic4ch.m4 b/tools/topology/topology1/sof-acp-rmb-dmic4ch.m4 new file mode 100644 index 000000000..ac4399bfa --- /dev/null +++ b/tools/topology/topology1/sof-acp-rmb-dmic4ch.m4 @@ -0,0 +1,67 @@ +# +# Topology for Renoir with I2S SP and DMIC. +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`acp-hs.m4') +include(`acp-dmic.m4') +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include ACP DSP configuration +include(`platform/amd/acp.m4') + +# Playback pipeline 1 on PCM 0 using max 2 channels of s16le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4, + 1, 0, 2, s16le, + 2000, 0, 0, + 48000, 48000, 48000) + +# playback DAI is ACPHS using 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, 1, ACPHS, 0, acp-headset-codec, +PIPELINE_SOURCE_1, 2, s16le, 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +DAI_CONFIG(ACPHS, 0, 0, acp-headset-codec, + ACPHS_CONFIG(I2S, ACP_CLOCK(mclk, 49152000, codec_mclk_in), + ACP_CLOCK(bclk, 3072000, codec_slave), + ACP_CLOCK(fsync, 48000, codec_slave), + ACP_TDM(2, 32, 3, 3),ACPHS_CONFIG_DATA(ACPHS, 0, 48000, 2, 0))) + +# Capture pipeline 2 on PCM 0 using max 2 channels of s16le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 2, 0, 2, s16le, + 2000, 0, 0, + 48000, 48000, 48000) + +# Capture DAI is ACPHS using 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, 2, ACPHS, 0, acp-headset-codec, +PIPELINE_SINK_2, 2, s16le, 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +# PCM id 0 +PCM_DUPLEX_ADD(I2SHS, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +#/**********************************************************************************/ +#DMIC +# Capture pipeline 3 on PCM 1 using max 2 channels of s32le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 3, 1, 4, s32le, + 2000, 0, 0, + 48000, 48000, 48000) + +DAI_ADD(sof/pipe-dai-capture.m4, 3, ACPDMIC, 0, acp-dmic-codec, +PIPELINE_SINK_3, 2, s32le, 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +dnl DAI_CONFIG(type, dai_index, link_id, name, acpdmic_config) +DAI_CONFIG(ACPDMIC, 3, 2, acp-dmic-codec, + ACPDMIC_CONFIG(ACPDMIC_CONFIG_DATA(ACPDMIC, 3, 48000, 4))) + +# PCM id 1 +PCM_CAPTURE_ADD(DMIC, 1, PIPELINE_PCM_3) +#/**********************************************************************************/