On 5/31/2018 00:04, Ranjani Sridharan wrote:
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add macro to build for switch widget
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/switch.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 topology/m4/switch.m4
diff --git a/topology/m4/switch.m4 b/topology/m4/switch.m4 new file mode 100644 index 0000000..33be9f2 --- /dev/null +++ b/topology/m4/switch.m4 @@ -0,0 +1,46 @@ +divert(-1)
+dnl Define macro for Switch widget
+dnl Mixer Name) +define(`N_SWITCH', `SWITCH'PIPELINE_ID`.'$1)
+dnl Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_SWITCH', `SWITCH'$1`.'$2)
+dnl W_SWITCH(name, format, periods_sink, periods_source, preload, kcontrols_list) +define(`W_SWITCH', +`SectionVendorTuples."'N_SWITCH($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR( $3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_w" {' +` tuples "'N_SWITCH($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SWITCH($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_str" {' +` tuples "'N_SWITCH($1)`_tuples_str"' +`}' +`SectionWidget."'N_SWITCH($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"'
Is this a misnomer maybe, there's already a mixer widget in mixer.m4 thats type "mixer". If not, maybe we use that instead?
Sorry, this is a copy paste typo. I will change it to "switch"
Thanks Xiuli
+` no_pm "true"' +` data [' +` "'N_SWITCH($1)`_data_w"' +` "'N_SWITCH($1)`_data_str"' +` ]' +` mixer ['
$6
+` ]' +`}')
+divert(0)dnl
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware