From 35420bec93f1cc7ba3aec4c754cf8025beeb7675 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Fri, 18 May 2018 16:56:46 +0800 Subject: [PATCH] topology: add virtual dapm route supported in topology file To reuse some machine drivers in Linux kernel without hacking dapm route info, some unsupported routes and widgets could be added in toplogy file. Signed-off-by: Rander Wang --- topology/m4/utils.m4 | 38 ++++++++++++++++++++++++++++++++++++++ topology/sof-cnl-rt274.m4 | 11 +++++++++++ 2 files changed, 49 insertions(+) diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index ba87c8d1e..8b397b627 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -70,5 +70,43 @@ define(`W_DATA', ` tuples STR($2)' `}') +dnl VIRTUAL_DAPM_ROUTE_OUT(name, dai type, dai index, direction, index) +define(`VIRTUAL_DAPM_ROUTE_OUT', +`SectionWidget.STR($1) {' +` index STR($5)' +` type "aif_out"' +` no_pm "true"' +`}' +`SectionGraph.STR($2) {' +` index STR($5)' +`' +` lines [' +` dapm($1,$2$3.$4)' +` ]' +`}') + +dnl VIRTUAL_DAPM_ROUTE_IN(name, dai type, dai index, direction, index) +define(`VIRTUAL_DAPM_ROUTE_IN', +`SectionWidget.STR($1) {' +` index STR($5)' +` type "aif_in"' +` no_pm "true"' +`}' +`SectionGraph.STR($2) {' +` index STR($5)' +`' +` lines [' +` dapm($2$3.$4, $1)' +` ]' +`}') + +dnl VIRTUAL_WIDGET(name, index) +define(`VIRTUAL_WIDGET', +`SectionWidget.STR($1) {' +` index STR($2)' +` type "mixer"' +` no_pm "true"' +`}') + divert(0) dnl diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4 index 89d5a259d..36cd91f5c 100644 --- a/topology/sof-cnl-rt274.m4 +++ b/topology/sof-cnl-rt274.m4 @@ -69,3 +69,14 @@ DAI_CONFIG(SSP, 0, SSP0-Codec, DSP_B, 24, DAI_CLOCK(bclk, 4800000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(4, 25, 3, 3)) + +VIRTUAL_DAPM_ROUTE_OUT(codec0_out, SSP, 0, OUT, 0) +VIRTUAL_DAPM_ROUTE_OUT(codec1_out, SSP, 0, OUT, 1) +VIRTUAL_DAPM_ROUTE_OUT(ssp0 Tx, SSP, 0, OUT, 2) +VIRTUAL_DAPM_ROUTE_OUT(Capture, SSP, 0, OUT, 3) +VIRTUAL_DAPM_ROUTE_OUT(SoC DMIC, SSP, 0, OUT, 4) +VIRTUAL_DAPM_ROUTE_IN(codec0_in, SSP, 0, IN, 5) +VIRTUAL_WIDGET(DMIC01 Rx, 6) +VIRTUAL_WIDGET(DMic, 7) +VIRTUAL_WIDGET(dmic01_hifi, 8) +VIRTUAL_WIDGET(ssp0 Rx, 9)