Skip to content

Commit

Permalink
topology: sof-jsl-rt5682: add support for cs42l42 with max98360a
Browse files Browse the repository at this point in the history
Add support for cs42l42 with max98360a running on JSL boards. The
cs42l42 needs to enable bclk earlier in prepare stage and disable bclk
at hw_free statge so we add the SSP_CC_BCLK_ES flag for it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
(cherry picked from commit 80a7795)
  • Loading branch information
brentlu authored and kv2019i committed Sep 20, 2024
1 parent c2cd312 commit d1a251c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tools/topology/topology1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ set(TPLGS
"sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl"
"sof-jsl-da7219\;sof-jsl-da7219-mx98360a\;-DPLATFORM=jsl-dedede"
"sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec"
"sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DPLATFORM=jsl-rt1015"
"sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1"
"sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DPLATFORM=jsl-dedede"
"sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-rt1015"
"sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1"
"sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-dedede"
"sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DHEADPHONE=cs42l42\;-DPLATFORM=jsl-dedede"
"sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP"

## DRC/EQ topologies
Expand Down
17 changes: 15 additions & 2 deletions tools/topology/topology1/sof-jsl-rt5682.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#
# Topology for JasperLake with rt5682 codec + DMIC + 3 HDMI + Speaker amp
# Topology for JasperLake with rt5682 or cs42l42 codec +
# DMIC +
# 3 HDMI +
# speaker amp
#

# Include topology builder
Expand All @@ -25,7 +28,7 @@ DEBUG_START
#
ifdef(`NO_AMP',`',`
# PCM0 ----> volume -----> SSP1 (Speaker - ALC1015)')
# PCM1 <---> volume <----> SSP0 (Headset - ALC5682)
`# PCM1 <---> volume <----> SSP0 (Headset - 'HEADPHONE`)'
# PCM2 ----> volume -----> iDisp1
# PCM3 ----> volume -----> iDisp2
# PCM4 ----> volume -----> iDisp3
Expand Down Expand Up @@ -176,13 +179,23 @@ dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data)
dnl SSP_CLOCK(clock, freq, codec_master, polarity)
dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id)

ifelse(HEADPHONE, `rt5682', `
# SSP 0 (ID: 0) ALC5682
DAI_CONFIG(SSP, 0, 0, SSP0-Codec,
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in),
SSP_CLOCK(bclk, 2400000, codec_slave),
SSP_CLOCK(fsync, 48000, codec_slave),
SSP_TDM(2, 25, 3, 3),
SSP_CONFIG_DATA(SSP, 0, 24)))
', HEADPHONE, `cs42l42', `
# SSP 0 (ID: 0) CS42L42
DAI_CONFIG(SSP, 0, 0, SSP0-Codec,
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in),
SSP_CLOCK(bclk, 2400000, codec_slave),
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)))
', )

ifdef(`NO_AMP',`',`
# SSP 1 (ID: 6)
Expand Down

0 comments on commit d1a251c

Please sign in to comment.