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

topology1: add sdw multi-function codec support #34

Open
wants to merge 1 commit into
base: mac-stable-v2.2
Choose a base branch
from
Open
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/topology1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ set(TPLGS
"sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1"
"sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1"
"sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1"
"sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-cs42l43-l0\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DMIC_LINK=0\;-DAMP_1_LINK=0\;-DMONO\;-DMFC"
"sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl"
"sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl"
"sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl"
Expand Down
70 changes: 50 additions & 20 deletions tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,36 @@ ifdef(`MIC_LINK',`',
# HDMI ID calculated based on the configuraiton
define(HDMI_BE_ID_BASE, `0')

# SDW Pin as DAIs index starts from 2 on each SDW link
define(`ALH_JACK_OUT_PIN', `2')
define(`ALH_JACK_IN_PIN', `3')
define(`ALH_AMP_OUT_PIN', `2')
define(`ALH_DMIC_IN_PIN', `2')

define(`ALH_JACK_OUT_NAME', `SDW'eval(UAJ_LINK)`-Playback')
define(`ALH_JACK_IN_NAME', `SDW'eval(UAJ_LINK)`-Capture')
define(`ALH_AMP_OUT_NAME', `SDW'eval(AMP_1_LINK)`-Playback')
define(`ALH_DMIC_IN_NAME', `SDW'eval(MIC_LINK)`-Capture')

ifdef(`MFC', `
undefine(`ALH_JACK_IN_PIN')
undefine(`ALH_AMP_OUT_PIN')
undefine(`ALH_DMIC_IN_PIN')
define(`ALH_JACK_IN_PIN', `4')
define(`ALH_AMP_OUT_PIN', `5')
define(`ALH_DMIC_IN_PIN', `3')

# align the partial string match of full dai link name
undefine(`ALH_JACK_OUT_NAME')
undefine(`ALH_JACK_IN_NAME')
undefine(`ALH_AMP_OUT_NAME')
undefine(`ALH_DMIC_IN_NAME')
define(`ALH_JACK_OUT_NAME', `Playback-SimpleJack')
define(`ALH_JACK_IN_NAME', `Capture-SimpleJack')
define(`ALH_AMP_OUT_NAME', `Playback-SmartAmp')
define(`ALH_DMIC_IN_NAME', `Capture-SmartMic')'
)

ifdef(`NO_JACK', `',
`undefine(`HDMI_BE_ID_BASE')
define(HDMI_BE_ID_BASE, `2')'
Expand Down Expand Up @@ -106,16 +136,16 @@ ifdef(`NOJACK', `',
`
# PCM0 ---> volume ----> mixer --->ALH 2 BE UAJ_LINK
# PCM31 ---> volume ------^
# PCM1 <--- volume <---- ALH 3 BE UAJ_LINK
# PCM1 <--- volume <---- ALH 3/4 BE UAJ_LINK
')
ifdef(`NOAMP', `',
`
# PCM2 ---> volume ----> ALH 2 BE AMP_1_LINK
# PCM2 ---> volume ----> ALH 2/5 BE AMP_1_LINK
ifdef(`MONO', `',
`# PCM40 ---> volume ----> ALH 2 BE AMP_2_LINK')
`# PCM40 ---> volume ----> ALH 2/5 BE AMP_2_LINK')
')
ifdef(`NO_LOCAL_MIC', `',
`# PCM4 <--- volume <---- ALH 2 BE MIC_LINK')
`# PCM4 <--- volume <---- ALH 2/3 BE MIC_LINK')

ifdef(`NOHDMI', `',
`
Expand Down Expand Up @@ -215,14 +245,14 @@ ifdef(`NOJACK', `',
# The NOT_USED_IGNORED is due to dependencies and is adjusted later with an explicit dapm line.

DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4,
1, ALH, eval(UAJ_LINK * 256 + 2), `SDW'eval(UAJ_LINK)`-Playback',
1, ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), ALH_JACK_OUT_NAME,
NOT_USE_IGNORED, 2, s24le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)

# capture DAI is ALH(UAJ_LINK PIN3) 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,
2, ALH, eval(UAJ_LINK * 256 + 3), `SDW'eval(UAJ_LINK)`-Capture',
2, ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), ALH_JACK_IN_NAME,
PIPELINE_SINK_2, 2, s24le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)

Expand Down Expand Up @@ -271,13 +301,13 @@ ifdef(`NOAMP', `',
# playback DAI is ALH(AMP_1_LINK PIN2/AMP_2_LINK PIN2) using 2 periods
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
DAI_ADD(sof/pipe-dai-playback.m4,
3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback',
3, ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), ALH_AMP_OUT_NAME,
PIPELINE_SOURCE_3, 2, s24le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)

ifdef(`MONO', `',
`DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4,
4, ALH, eval(AMP_2_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback',
4, ALH, eval(AMP_2_LINK * 256 + ALH_AMP_OUT_PIN), ALH_AMP_OUT_NAME,
PIPELINE_SOURCE_4, 2, s24le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER,
PIPELINE_PLAYBACK_SCHED_COMP_3)
Expand All @@ -299,7 +329,7 @@ ifdef(`NO_LOCAL_MIC', `',
# capture DAI is ALH(MIC_LINK PIN2) 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,
5, ALH, eval(MIC_LINK * 256 + 2), `SDW'eval(MIC_LINK)`-Capture',
5, ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), ALH_DMIC_IN_NAME,
PIPELINE_SINK_5, 2, s24le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
')
Expand Down Expand Up @@ -362,26 +392,26 @@ ifdef(`NOJACK', `',
`
#ALH dai index = ((link_id << 8) | PDI id)
#ALH UAJ_LINK Pin2 (ID: 0)
DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 2), 0, `SDW'eval(UAJ_LINK)`-Playback',
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 2), 48000, 2)))
DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), 0, ALH_JACK_OUT_NAME,
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), 48000, 2)))

#ALH UAJ_LINK Pin3 (ID: 1)
DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 3), 1, `SDW'eval(UAJ_LINK)`-Capture',
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 3), 48000, 2)))
#ALH UAJ_LINK Pin3/4 (ID: 1)
DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), 1, ALH_JACK_IN_NAME,
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), 48000, 2)))
')

ifdef(`NOAMP', `',
`
#ALH AMP_1_LINK Pin2 (ID: 2)
DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback',
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2)))
#ALH AMP_1_LINK Pin2/5 (ID: 2)
DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), 2, ALH_AMP_OUT_NAME,
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), 48000, 2)))
')

ifdef(`NO_LOCAL_MIC', `',
`
#ALH MIC_LINK Pin2 (ID: 4)
DAI_CONFIG(ALH, eval(MIC_LINK * 256 + 2), 4, `SDW'eval(MIC_LINK)`-Capture',
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + 2), 48000, 2)))
#ALH MIC_LINK Pin2/3 (ID: 4)
DAI_CONFIG(ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), 4, ALH_DMIC_IN_NAME,
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), 48000, 2)))
')

ifdef(`NOHDMI', `',
Expand Down
Loading