[alsa-devel] [PATCH] ASoC: davinci-evm: Register machine level DAPM elements with the card

Mark Brown broonie at kernel.org
Mon Mar 10 18:41:44 CET 2014

On Mon, Mar 03, 2014 at 08:20:55AM +0100, Lars-Peter Clausen wrote:
> Machine level DAPM widgets and routes should be registered in the card's DAPM
> context, rather than in the CODEC's context.

>  static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd)
>  {
> +	struct snd_soc_card *card = rtd->card;
>  	struct snd_soc_codec *codec = rtd->codec;
>  	struct snd_soc_dapm_context *dapm = &codec->dapm;

My first thought is why are we looking at the CODEC DAPM context at all
here and shouldn't we just change to using that here?  Yes, it does mean
that we look for the CODEC pins in the card DAPM but they kind of are
card widgets provided by the CODEC - or we could make those be the
"non-default" context.

While we're at it the not connected pins should be changed to _nc_pin()
on the off chance that we ever get round to doing the core changes to
mask inaccessible routes/options.

> -	snd_soc_dapm_enable_pin(dapm, "Line In");
> +	snd_soc_dapm_enable_pin(&card->dapm, "Headphone Jack");
> +	snd_soc_dapm_enable_pin(&card->dapm, "Line Out");
> +	snd_soc_dapm_enable_pin(&card->dapm, "Mic Jack");
> +	snd_soc_dapm_enable_pin(&card->dapm, "Line In");

The enables could just be dropped, it's the default.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140310/af0094aa/attachment.sig>

More information about the Alsa-devel mailing list