On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add a switch widget for playback dai as the loopback dai. The switch will control the software dai loopback.
This should belong to a DAI, not pipeline, we should add LBM switch for each dai(or actually SSP), not for specific playback or capture pipelines.
Thanks, ~Keyon
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 topology/sof/pipe-dai-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai-loopback.m4 new file mode 100644 index 0000000..e62f6b0 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4 @@ -0,0 +1,36 @@ +# DAI Playback connector
+# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`mixercontrol.m4') +include(`switch.m4')
+# +# DAI definitions +# +C_CONTROLMIXER(Loop Back Switch, PIPELINE_ID,
- CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, volsw, volsw),
- CONTROLMIXER_MIN(, 0),
- CONTROLMIXER_MAX(, 1),
- false,
- ,
- Channel register and shift for Front Left/Right,
- LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)))
+W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf) +W_SWITCH(LoopBack, DAI_FORMAT, 1, 1, 1, LIST(` ', "Loop Back Switch PIPELINE_ID"))
+# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
+# +# Graph connections to pipelines
+P_GRAPH(DAI_NAME, PIPELINE_ID,
- LIST(` ',
- `kdapm(N_SWITCH(LoopBack), Loop Back Switch PIPELINE_ID, DAI_BUF)',
- `dapm(N_DAI_OUT, N_SWITCH(LoopBack))'))