[alsa-devel] [PATCH] ASoC: pcm512x: Implement the digital_mute interface
Mark Brown
broonie at kernel.org
Mon Nov 26 15:02:00 CET 2018
On Sat, Nov 24, 2018 at 10:05:42PM +0200, Dimitris Papavasiliou wrote:
> +static int pcm512x_digital_playback_switch_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
> + struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
> +
> + mutex_lock(&pcm512x->mutex);
> + ucontrol->value.integer.value[0] = !(pcm512x->mute & 0x4);
> + ucontrol->value.integer.value[1] = !(pcm512x->mute & 0x2);
> + mutex_unlock(&pcm512x->mutex);
> +
> + return 0;
> +}
Just remove the control, no need to jump through these hoops.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20181126/f24f6ef1/attachment.sig>
More information about the Alsa-devel
mailing list