RE: [PATCH Resend 7/8] ASoC: addsnd_soc_of_parse_audio_simple_widgets for DeviceTree

From: Li.Xiubo@xxxxxxxxxxxxx
Date: Thu Jan 23 2014 - 21:46:57 EST



> > +static struct snd_soc_dapm_widget simple_widgets[] = {
> > + SND_SOC_DAPM_MIC("Mic", NULL),
> > + SND_SOC_DAPM_LINE("Line", NULL),
> > + SND_SOC_DAPM_HP("Hp", NULL),
> > + SND_SOC_DAPM_SPK("Spk", NULL),
> > +};
>

This is the templates for "Microphone XXX", "Line XXX", "Headphone XXX"
and "Spk XXX" .



> Does this mean we're restricted to a particular set of names? That
> seems sad and won't work if there's a desire for more than one of a
> given widget - the main use case I can see is multiple microphones with
> separate microphone biases. How about having some templates that we
> copy and then replace the name with the one the user supplied?
>

This code has already supplied this I think.

Using this API, the only limitation is that, for example if the user has
multiple Microphones, it should set the name in DT file like:

"Mic XXX", "Mic YYY", "Mic ZZZ"...

And these widgets will use the template of : SND_SOC_DAPM_MIC("Mic", NULL),
And the widgets' names will be replaced with "Mic XXX", "Mic YYY",
"Mic ZZZ"... from the user's DT node.



Or your suggestion is :

The templates is:
+static struct snd_soc_dapm_widget simple_widgets[] = {
+ SND_SOC_DAPM_MIC("Mic", NULL),
+ SND_SOC_DAPM_LINE("Line", NULL),
+ SND_SOC_DAPM_HP("Hp", NULL),
+ SND_SOC_DAPM_SPK("Spk", NULL),
+};

And in the DT node:
simple-off-codec-widgets =
/* template-name user-supplied-name */
"Mic", "Microphone XXX",
"Mic", "UUU Microphone YYY",
"Hp", "TTT Headphone XXX",
"Hp", "Headphone YYY";

And then just replace the template's name with the user supplied name?


Thanks,

Best Regards,
Xiubo
韬{.n?????%?lzwm?b?Р骒r?zXЩ??{ay????j?f"?????ア?⒎?:+v???????赙zZ+????"?!?O???v??m?鹈 n?帼Y&—