From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ashish Chavan Subject: Re: [PATCH v5 2/2] ASoC: da7210: Add support for ALC and Noise suppression Date: Wed, 19 Oct 2011 14:13:30 +0530 Message-ID: <1319013810.7230.40.camel@matrix> References: <1318945431.13721.52.camel@matrix> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from DB3EHSOBE006.bigfish.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by alsa0.perex.cz (Postfix) with ESMTP id 486EA2447A for ; Wed, 19 Oct 2011 10:33:31 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: "Girdwood, Liam" Cc: alsa-devel , Mark Brown , linux-kernel , "kuninori.morimoto.gx" , David Dajun Chen List-Id: alsa-devel@alsa-project.org > > + 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.