mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricard Wanderlof <ricardw@axis.com>
To: Dan Murphy <dmurphy@ti.com>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"perex@perex.cz" <perex@perex.cz>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Ricard Wanderlöf" <Ricard.Wanderlof@axis.com>
Subject: Re: [PATCH for-next] ASoC: tlv320adcx140: Fix MIC_BIAS defines for ADC full scale
Date: Thu, 27 Feb 2020 09:07:28 +0100	[thread overview]
Message-ID: <alpine.DEB.2.20.2002270906590.29598@lnxricardw1.se.axis.com> (raw)
In-Reply-To: <20200226133439.15837-1-dmurphy@ti.com>


On Wed, 26 Feb 2020, Dan Murphy wrote:

> Change the #defines for the ADC full scale bits from MIC_BIAS to
> ADC_FSCALE.  This also changes the error message to incidate ADC full
> scale value error as opposed to the Mic bias.
> 
> Reported-by: Ricard Wanderlof <ricardw@axis.com>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  sound/soc/codecs/tlv320adcx140.c | 12 ++++++------
>  sound/soc/codecs/tlv320adcx140.h |  8 ++++----
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/sound/soc/codecs/tlv320adcx140.c
> b/sound/soc/codecs/tlv320adcx140.c
> index 93a0cb8e662c..825ace9b5fa7 100644
> --- a/sound/soc/codecs/tlv320adcx140.c
> +++ b/sound/soc/codecs/tlv320adcx140.c
> @@ -758,12 +758,12 @@ static int adcx140_codec_probe(struct
> snd_soc_component *component)
>          ret = device_property_read_u8(adcx140->dev, "ti,vref-source",
>                                        &vref_source);
>          if (ret)
> -               vref_source = ADCX140_MIC_BIAS_VREF_275V;
> +               vref_source = ADCX140_ADC_FSCALE_VREF_275V;
>  
> -       if (vref_source != ADCX140_MIC_BIAS_VREF_275V &&
> -           vref_source != ADCX140_MIC_BIAS_VREF_25V &&
> -           vref_source != ADCX140_MIC_BIAS_VREF_1375V) {
> -               dev_err(adcx140->dev, "Mic Bias source value is invalid\n");
> +       if (vref_source != ADCX140_ADC_FSCALE_VREF_275V &&
> +           vref_source != ADCX140_ADC_FSCALE_VREF_25V &&
> +           vref_source != ADCX140_ADC_FSCALE_VREF_1375V) {
> +               dev_err(adcx140->dev, "ADC full scale setting is
> invalid\n");
>                  return -EINVAL;
>          }
>  
> @@ -787,7 +787,7 @@ static int adcx140_codec_probe(struct snd_soc_component
> *component)
>  
>          ret = regmap_update_bits(adcx140->regmap, ADCX140_BIAS_CFG,
>                                  ADCX140_MIC_BIAS_VAL_MSK |
> -                               ADCX140_MIC_BIAS_VREF_MSK, bias_source);
> +                               ADCX140_ADC_FSCALE_VREF_MSK, bias_source);
>          if (ret)
>                  dev_err(adcx140->dev, "setting MIC bias failed %d\n", ret);
>  out:
> diff --git a/sound/soc/codecs/tlv320adcx140.h
> b/sound/soc/codecs/tlv320adcx140.h
> index 6d055e55909e..adb9513900b1 100644
> --- a/sound/soc/codecs/tlv320adcx140.h
> +++ b/sound/soc/codecs/tlv320adcx140.h
> @@ -117,10 +117,10 @@
>  #define ADCX140_MIC_BIAS_VAL_AVDD       6
>  #define ADCX140_MIC_BIAS_VAL_MSK GENMASK(6, 4)
>  
> -#define ADCX140_MIC_BIAS_VREF_275V     0
> -#define ADCX140_MIC_BIAS_VREF_25V      1
> -#define ADCX140_MIC_BIAS_VREF_1375V    2
> -#define ADCX140_MIC_BIAS_VREF_MSK GENMASK(1, 0)
> +#define ADCX140_ADC_FSCALE_VREF_275V   0
> +#define ADCX140_ADC_FSCALE_VREF_25V    1
> +#define ADCX140_ADC_FSCALE_VREF_1375V  2
> +#define ADCX140_ADC_FSCALE_VREF_MSK GENMASK(1, 0)
>  
>  #define ADCX140_PWR_CFG_BIAS_PDZ        BIT(7)
>  #define ADCX140_PWR_CFG_ADC_PDZ         BIT(6)
> --
> 2.25.0
> 
> 
> 

Looks good to me!

/Ricard
-- 
Ricard Wolf Wanderlof                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

      reply	other threads:[~2020-02-27  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 13:34 Dan Murphy
2020-02-27  8:07 ` Ricard Wanderlof [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.2002270906590.29598@lnxricardw1.se.axis.com \
    --to=ricardw@axis.com \
    --cc=Ricard.Wanderlof@axis.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dmurphy@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®