[alsa-devel] [PATCH 2/4] ASoC: Add optional pointer to machine audio routes to snd_soc_card

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Jan 26 14:35:22 CET 2011


On Wed, Jan 26, 2011 at 01:58:15PM +0200, Jarkko Nikula wrote:

> +		/*
> +		 * use the last codec and dapm context of it when setting up
> +		 * the common audio map
> +		 */
> +		codec = list_first_entry(&card->codec_dev_list,
> +					 struct snd_soc_codec, card_list);
> +		temp = codec->name_prefix;
> +		codec->name_prefix = NULL;
> +		ret = snd_soc_dapm_add_routes(&codec->dapm,
> +					      card->route, card->num_routes);

Rather than faff around like this it seems we should just bite the
bullet and add a DAPM context for the card.

Probably also worth doing the same thing as this for widgets - the
combination of these two would eliminate almost all machine init()
functions.


More information about the Alsa-devel mailing list