19 Oct
2011
19 Oct
'11
10:43 a.m.
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.