diff --git a/tools/topology/topology2/imx8-wm8960.conf b/tools/topology/topology2/imx8-wm8960.conf new file mode 100644 index 000000000000..ea6ccf92853b --- /dev/null +++ b/tools/topology/topology2/imx8-wm8960.conf @@ -0,0 +1,127 @@ +## +## Example topology for i.MX8MP board with 'CODEC' codec +## +## (source) host-copier.N.playback -> gain.N.1 -> dai-copier.SAI_DAI_INDEX(sink endpoint) +## + +# Include paths + + + + + + + +# Include class definitions + + + + + + + + + + + + + + + + + +Define { + HEADSET_PLAYBACK_PCM_STREAM_NAME "Headset Playback" + HEADSET_PCM_NAME "Headset" + HEADSET_PCM_ID 0 +} + +# +# Pipeline definitions +# +# (source) host.N.playback -> gain.N.1 +# +Object.Pipeline { + gain-playback [ + { + index 1 + + Object.Widget.host-copier.1 { + stream_name $HEADSET_PLAYBACK_PCM_STREAM_NAME + pcm_id $HEADSET_PCM_ID + } + + Object.Widget.gain.1 { + curve_type "windows_fade" + Object.Control.mixer.1 { + name 'Playback Volume' + } + } + + time_domain "dma" + format "s32le" + num_input_audio_formats 3 + num_output_audio_formats 1 + } + ] +} + +Object.Widget { + dai-copier."1" { + dai_index $SAI_DAI_INDEX + dai_type "SAI" + copier_type "SAI" + stream_name $STREAM_CODEC_NAME + node_type $I2S_LINK_OUTPUT_CLASS + type dai_in + num_input_audio_formats 1 + num_output_audio_formats 1 + num_input_pins 1 + direction "playback" + + # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } +} + +# PCM Definitions +Object.PCM.pcm [ + { + name $HEADSET_PCM_NAME + direction "playback" + id $HEADSET_PCM_ID + + Object.Base.fe_dai.1 { + name "$HEADSET_PCM_NAME" + } + + Object.PCM.pcm_caps.playback { + name $HEADSET_PLAYBACK_PCM_STREAM_NAME + formats 'S32_LE,S24_LE,S16_LE' + } + } +] + +# Top-level pipeline connection +# gain.1. -> dai.SAI.1.playback +Object.Base.route [ + { + source "host-copier.$HEADSET_PCM_ID.playback" + sink "gain.1.1" + } + { + source "gain.1.1" + sink "dai-copier.SAI.$STREAM_CODEC_NAME.playback" + } +] diff --git a/tools/topology/topology2/production/CMakeLists.txt b/tools/topology/topology2/production/CMakeLists.txt index 0d340260edd4..3d1d39d7eb2d 100644 --- a/tools/topology/topology2/production/CMakeLists.txt +++ b/tools/topology/topology2/production/CMakeLists.txt @@ -4,6 +4,7 @@ include(tplg-targets-hda-generic.cmake) include(tplg-targets-cavs25.cmake) include(tplg-targets-ace1.cmake) include(tplg-targets-ace2.cmake) +include(tplg-targets-imx8.cmake) add_custom_target(topology2_prod) diff --git a/tools/topology/topology2/production/tplg-targets-imx8.cmake b/tools/topology/topology2/production/tplg-targets-imx8.cmake new file mode 100644 index 000000000000..34977808d962 --- /dev/null +++ b/tools/topology/topology2/production/tplg-targets-imx8.cmake @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause + +# Array of "input-file-name;output-file-name;comma separated pre-processor variables" +list(APPEND TPLGS +# IPC4 topology for i.MX8MP + WM8960 Codec +"imx8-wm8960\;sof-imx8mp-wm8960\;SAI_DAI_INDEX=3,STREAM_CODEC_NAME=sai3-wm8960-hifi" +)