[alsa-devel] [PATCH V2 2/2] ASoC: img: Add driver for Pistachio internal DAC

Mark Brown broonie at kernel.org
Tue Dec 8 20:00:05 CET 2015


On Tue, Dec 08, 2015 at 05:05:24PM +0000, Damien Horsley wrote:

> +static int pistachio_internal_dac_set_mute(struct snd_kcontrol *kcontrol,
> +				  struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
> +	struct pistachio_internal_dac *dac = snd_soc_codec_get_drvdata(codec);
> +	u32 reg;
> +
> +	dac->mute = ucontrol->value.integer.value[0];
> +
> +	if (dac->mute)
> +		reg = PISTACHIO_INTERNAL_DAC_CTRL_MUTE_MASK;
> +	else
> +		reg = 0;
> +
> +	regmap_update_bits(dac->regmap, PISTACHIO_INTERNAL_DAC_CTRL,
> +			PISTACHIO_INTERNAL_DAC_CTRL_MUTE_MASK, reg);
> +
> +	return 0;
> +}

Shouldn't this just be a standard SOC_SINGLE() now?  We've got a regmap.
Otherwise this looks good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20151208/4b93c19a/attachment.sig>


More information about the Alsa-devel mailing list