From e835d57ef8b89ddc8f8bdf283e9470e5c88d6efd Mon Sep 17 00:00:00 2001 From: Mac Chiang Date: Mon, 16 Oct 2023 10:47:52 -0400 Subject: [PATCH] topology2: add ALC5650 codec support ALC5650 codec is I2S codec integrated Headphone and Speaker devices. SSP0 config for ALC5650 Speaker SSP2 config for ALC5650 Headphone add clks_control attribute {}. Because ALC5650 requires MCLK 24.576MHz always on and 24 valid bits. So that it will overriden the SSP_CLKS_CONTROL and SSP_SAMPLE_BITS. Otherwise, keep the default configurations. Signed-off-by: Mac Chiang --- tools/topology/topology2/cavs-rt5682.conf | 8 ++++++-- .../topology/topology2/include/dais/ssp.conf | 19 +++++++++++++++++++ .../topology2/sof-ace-tplg/tplg-targets.cmake | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index 721c97afe94e..d27e1ce74bdc 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -105,6 +105,8 @@ Define { GOOGLE_AEC_PIPELINE_PRIORITY 2 DMIC_PIPELINE_PRIORITY 1 ECHO_REF_PIPELINE_PRIORITY 0 + SAMPLE_BITS 32 + CLKS_CONTROL "0" } # override defaults with platform-specific config @@ -151,8 +153,9 @@ Object.Dai.SSP [ direction "duplex" name $HEADSET_CODEC_NAME default_hw_conf_id 0 - sample_bits 32 + sample_bits $SAMPLE_BITS io_clk $MCLK + clks_control $CLKS_CONTROL Object.Base.hw_config.1 { name $HEADSET_HW_CONFIG_NAME @@ -179,8 +182,9 @@ Object.Dai.SSP [ } name $SPEAKER_CODEC_NAME default_hw_conf_id 0 - sample_bits 32 + sample_bits $SAMPLE_BITS io_clk $MCLK + clks_control $CLKS_CONTROL Object.Base.hw_config.1 { name $SPEAKER_HW_CONFIG_NAME diff --git a/tools/topology/topology2/include/dais/ssp.conf b/tools/topology/topology2/include/dais/ssp.conf index 6c0d91f2bd69..8b0374c62823 100644 --- a/tools/topology/topology2/include/dais/ssp.conf +++ b/tools/topology/topology2/include/dais/ssp.conf @@ -54,6 +54,25 @@ Class.Dai."SSP" { DefineAttribute."default_hw_config_id" {} + DefineAttribute."clks_control" { + # Token reference and type + token_ref "intel_ssp.word" + constraints { + !valid_values [ + "0" + "mclk_es" + "bclk_es" + "mclk_aon" + ] + !tuple_values [ + 0 + 64 + 128 + 256 + ] + } + } + DefineAttribute."name" { type "string" } diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index f505b1e4a4e9..bacc762be970 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -51,6 +51,15 @@ SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAM BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\ DEEPBUFFER_D0I3_COMPATIBLE=true" +#RT5650 integrated codec support +"cavs-rt5682\;sof-mtl-rt5650-ssp2-ssp0\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ +PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\ +NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\ +SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\ +BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\ +DEEPBUFFER_D0I3_COMPATIBLE=true,SAMPLE_BITS=24,CLKS_CONTROL=mclk_aon" + + "cavs-rt5682\;sof-mtl-max98357a-rt5682-ssp2-ssp0-2ch-pdm1\;PLATFORM=mtl,NUM_DMICS=2,\ PDM0_MIC_A_ENABLE=0,PDM0_MIC_B_ENABLE=0,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682-2ch.bin,\