Skip to content

Commit

Permalink
topology1: sof-tgl-max98357a-rt5682: add sof-adl-rt5650 topology
Browse files Browse the repository at this point in the history
Add a new topology sof-adl-rt5650 for ALC5650 which supports SSP0 for
headset and SSP1 for speakers since this codec implements two I2S
interfaces.

DAI format changed to mclk: 24.576MHz, bclk: 3.072MHz, sample bits:
24-bit to avoid using ASRC function on codec side.

Signed-off-by: Brent Lu <[email protected]>
  • Loading branch information
brentlu authored and lgirdwood committed Sep 8, 2023
1 parent 2c6c1b4 commit bd6933b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/topology/topology1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ set(TPLGS
"sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC"
"sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000"
"sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC"
"sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC"
"sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1"
"sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-igonr\;-DAMP_SSP=1\;-DIGO"
"sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1"
Expand Down
32 changes: 30 additions & 2 deletions tools/topology/topology1/sof-tgl-max98357a-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,24 @@ DEBUG_START
#
ifdef(`2CH_2WAY', `ifdef(`4CH_PASSTHROUGH', `fatal_error(note: 2CH_2WAY and 4CH_PASSTHROUGH are mutually exclusive)')')

ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',`define(HEADPHONE, `RT5682')')
ifdef(`USE_DA7219',`define(MCLK_RATE, `24576000')',`define(MCLK_RATE, `19200000')')
#
# Set headphone type, default is RT5682
#
ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',`
ifdef(`USE_RT5650',`define(HEADPHONE, `RT5650')',`define(HEADPHONE, `RT5682')')')

#
# Set the MCLK rate for headphone and amplifier SSP ports
#
ifelse(
HEADPHONE, `DA7219', `
define(MCLK_RATE, `24576000')',
HEADPHONE, `RT5650', `
define(MCLK_RATE, `24576000')
define(CODEC, `RT5650')',
HEADPHONE, `RT5682', `
define(MCLK_RATE, `19200000')',
`fatal_error(note: unknown HEADPHONE type)')

#
# Define the demux configure
Expand Down Expand Up @@ -470,6 +486,12 @@ ifelse(
SSP_CLOCK(fsync, 48000, codec_slave),
SSP_TDM(4, 32, 3, 15),
SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))',
CODEC, `RT5650', `
SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, 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, 24, 0, 0, 0, SSP_CC_MCLK_AON)))',
)')

ifdef(`NO_HEADPHONE',`',`
Expand All @@ -488,6 +510,12 @@ ifelse(
SSP_CLOCK(fsync, 48000, codec_slave),
SSP_TDM(2, 25, 3, 3),
SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))',
HEADPHONE, `RT5650', `
SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, 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, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON)))',
)')

# 4 HDMI/DP outputs (ID: 3,4,5,6)
Expand Down

0 comments on commit bd6933b

Please sign in to comment.