8 Dec
2015
8 Dec
'15
8 p.m.
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.