[alsa-devel] [PATCH v5 2/2] ASoC: da7210: Add support for ALC and Noise suppression
Ashish Chavan
ashish.chavan at kpitcummins.com
Wed Oct 19 10:43:30 CEST 2011
> > + if (ucontrol->value.integer.value[0]) {
> > + /* Check if noise suppression is enabled */
> > + if (snd_soc_read(codec, DA7210_CONTROL) & DA7210_NOISE_SUP_EN) {
> > + dev_dbg(codec->dev,
> > + "Disable noise suppression to enable ALC\n");
> > + return -EPERM;
>
> -EINVAL
>
>
> > + /* Check ZC for HP and AUX1 PGA */
> > + if ((snd_soc_read(codec, DA7210_ZERO_CROSS) &
> > + (DA7210_AUX1_L_ZC | DA7210_AUX1_R_ZC | DA7210_HP_L_ZC |
> > + DA7210_HP_R_ZC)) != 0xc3)
>
> It may be clearer if you don't use the magic number here and specify
> the bits you are checking.
>
> > + /* If all conditions are met or we are actually disabling Noise sup */
> > + return snd_soc_put_volsw(kcontrol, ucontrol);
> > +
> > +err:
> > + return -EPERM;
>
> -EINVAL
>
Thanks. Updating and reposting the patch set.
More information about the Alsa-devel
mailing list