From b50afe03cdb8a5514040d1673312a0ab5c27547a Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Tue, 17 Aug 2021 16:48:53 +0800 Subject: [PATCH] topology: sof-tgl-max98357a-rt5682: add support for max98360a Add support for max98360a running on ADL boards. We choose SSP1 for speaker amplifier for BT offload compatibility. Also increase the sample depth to 32 bits for more dynamic range and avoid using m/n counter. We add the flag SSP_CC_BCLK_ES to SSP0 for the compatibility with CS42L42 in the future. Signed-off-by: Brent Lu --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 327440433..895faf04c 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -132,6 +132,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DAMP_SSP=2\;-DCHANNELS=2\;-DDMICPROC=eq-iir-volume\;-DRTNR" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DAMP_SSP=1" "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" "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" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DAMP_SSP=1" diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 8b48ceae5..255ddb01b 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -282,6 +282,12 @@ ifelse( SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 16, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', + CODEC, `MAX98360A', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `RT1011', ` SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), SSP_CLOCK(bclk, 4800000, codec_slave), @@ -296,7 +302,7 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24))) + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES))) # 4 HDMI/DP outputs (ID: 3,4,5,6) DAI_CONFIG(HDA, 0, 3, iDisp1,