[alsa-devel] [PATCH v2] ASoC: wm8741: Add differential mono mode support
Charles Keepax
ckeepax at opensource.wolfsonmicro.com
Mon May 11 13:50:34 CEST 2015
On Mon, May 11, 2015 at 11:12:00AM +0200, Sergej Sawazki wrote:
> On 11.05.2015 at 10:12, Charles Keepax wrote:
> > On Tue, May 05, 2015 at 10:46:31PM +0200, Sergej Sawazki wrote:
> >> +static int wm8741_add_controls(struct snd_soc_codec *codec)
> >> +{
> >> + struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
> >> +
> >> + switch (wm8741->pdata.diff_mode) {
> >> + case WM8741_DIFF_MODE_STEREO:
> >> + case WM8741_DIFF_MODE_STEREO_REVERSED:
> >> + snd_soc_add_codec_controls(codec, wm8741_snd_controls,
> >> + ARRAY_SIZE(wm8741_snd_controls));
> >> + break;
> >> + case WM8741_DIFF_MODE_MONO_LEFT:
> >> + case WM8741_DIFF_MODE_MONO_RIGHT:
> >> + /* The machine driver is responsible for mixer controls
> >> + * if the codec is configured in differential mono mode.
> >> + */
> > Would it not be better to add controls but with a channel neutral
> > name and then the machine driver can use the name_prefix stuff to
> > stick left and right onto them? Seems a bit odd for the machine
> > driver to have to know exact register details of the CODEC and
> > manually add the volume controls?
> >
> > Thanks,
> > Charles
>
> Charles, could you point me to an "name_prefix" example please?
>
> Thanks,
> Sergej
>
The wm9081's handling in sound/soc/samsung/bells.c would be a
reasonable example.
Thanks,
Charles
More information about the Alsa-devel
mailing list