[Sound-open-firmware] [RFC PATCH 3/5] topology: m4: add switch widget
Ranjani Sridharan
ranjani.sridharan at linux.intel.com
Thu May 31 04:42:48 CEST 2018
On Thu, 2018-05-31 at 10:09 +0800, Pan, Xiuli wrote:
>
> 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 at linux.intel.com>
> > >
> > > Add macro to build for switch widget
> > >
> > > Signed-off-by: Pan Xiuli <xiuli.pan at 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"
Xiuli, widget types are described in soc-dapm.h.
A switch type widget is described as follows:
snd_soc_dapm_switch, /* analog switch */
Are you sure we want this here?
> 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 at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar
> > e
>
> _______________________________________________
> Sound-open-firmware mailing list
> Sound-open-firmware at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
More information about the Sound-open-firmware
mailing list