[alsa-devel] [PATCH 4/4] ASoC: wm5110: Add additional analogue input enable for early revs

Mark Brown broonie at kernel.org
Wed Sep 16 22:02:00 CEST 2015


On Wed, Sep 16, 2015 at 01:59:43PM +0100, Charles Keepax wrote:

> +static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol,
> +			     struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
> +	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
> +	struct snd_soc_card *card = dapm->card;
> +	int ret;
> +
> +	mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
> +
> +	ret = snd_soc_get_volsw_range(kcontrol, ucontrol);
> +
> +	mutex_unlock(&card->dapm_mutex);

Can we please have a comment explaining why we need the lock (I see why
but someone reading the code in the future might not)?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150916/83958fac/attachment.sig>


More information about the Alsa-devel mailing list