[alsa-devel] [PATCH v2] ASoC: wm8741: Add differential mono mode support

Sergej Sawazki ce3a at gmx.de
Mon May 11 11:12:00 CEST 2015


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



More information about the Alsa-devel mailing list