Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topology: Add support for MAX98390 echo reference capture #3971

Merged
merged 1 commit into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ set(TPLGS
"sof-apl-da7219\;sof-apl-da7219"
"sof-glk-da7219-kwd\;sof-glk-da7219-kwd\;-DPLATFORM=glk"
"sof-glk-da7219-kwd\;sof-cml-da7219-max98357a\;-DPLATFORM=cml"
"sof-glk-da7219-kwd\;sof-cml-da7219-max98390\;-DCODEC=MAX98390\;-DPLATFORM=cml"
"sof-glk-da7219\;sof-glk-da7219"
"sof-glk-rt5682\;sof-glk-rt5682"
"sof-icl-nocodec\;sof-icl-nocodec\;-DPLATFORM=icl"
Expand Down
24 changes: 24 additions & 0 deletions tools/topology/sof-glk-da7219-kwd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ define(DMIC_16k_PCM_NAME, `DMIC16k')

define(KWD_PIPE_SCH_DEADLINE_US, 20000)

ifelse(CODEC, `MAX98390',`
define(`SSP1_VALID_BITS_STR', `s32le')
define(`SSP1_BCLK', 3072000)
define(`SSP1_VALID_BITS', 32)')

#
# Define the pipelines
#
# PCM0 ----> volume (pipe 1) -----> SSP1 (speaker - maxim98357a, BE link 0)
# PCM1 <---> volume (pipe 2,3) <----> SSP(SSP_INDEX) (headset - dailog7219, BE link 1)
# PCM(DMIC_PCM_NUM) <---- DMIC0 (dmic capture, BE link 2)
ifelse(CODEC, `MAX98390',`
# PCM4 <---- passthrough (pipe 10) <----- SSP1 (echoref - maxim98390, BE link 0)')
# PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 3)
# PCM6 ----> volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 4)
# PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 5)
Expand Down Expand Up @@ -93,6 +100,13 @@ PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
1000, 0, 0,
48000, 48000, 48000)

ifelse(CODEC, `MAX98390',`
# Capture pipeline 10 on PCM 4 using max 2 channels of s32le.
PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
10, 4, 2, s32le,
1000, 0, 0,
48000, 48000, 48000)')

#
# DAIs configuration
#
Expand All @@ -109,6 +123,14 @@ DAI_ADD(sof/pipe-dai-playback.m4,
PIPELINE_SOURCE_1, 2, SSP1_VALID_BITS_STR,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)

ifelse(CODEC, `MAX98390',`
# Capture DAI is SSP1 using 2 periods
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
DAI_ADD(sof/pipe-dai-capture.m4,
10, SSP, 1, SSP1-Codec,
PIPELINE_SINK_10, 2, SSP1_VALID_BITS_STR,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)')

# playback DAI is SSP(SSP_INDEX) using 2 periods
# Buffers use s16le format, 1000us deadline on core 0 with priority 0
DAI_ADD(sof/pipe-dai-playback.m4,
Expand Down Expand Up @@ -177,6 +199,8 @@ PCM_CAPTURE_ADD(DMIC, DMIC_PCM_NUM, PIPELINE_PCM_4)
PCM_PLAYBACK_ADD(HDMI1, 5, PIPELINE_PCM_5)
PCM_PLAYBACK_ADD(HDMI2, 6, PIPELINE_PCM_6)
PCM_PLAYBACK_ADD(HDMI3, 7, PIPELINE_PCM_7)
ifelse(CODEC, `MAX98390',`
PCM_CAPTURE_ADD(EchoRef, 4, PIPELINE_PCM_10)')

# keyword detector pipe
dnl PIPELINE_ADD(pipeline,
Expand Down