From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Hebbar Gururaja <gururaja.hebbar@ti.com>
Cc: alsa-devel@alsa-project.org, sudhakar.raj@ti.com,
tony@atomide.com, broonie@opensource.wolfsonmicro.com,
nsekhar@ti.com, davinci-linux-open-source@linux.davincidsp.com,
lgirdwood@gmail.com, alsa-user@lists.sourceforge.net,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] ASoC: tlv320aic3x: Convert mic bias to a supply widget
Date: Thu, 31 Jan 2013 09:02:22 +0100 [thread overview]
Message-ID: <510A250E.4000706@ti.com> (raw)
In-Reply-To: <1359552155-17426-1-git-send-email-gururaja.hebbar@ti.com>
On 01/30/2013 02:22 PM, Hebbar Gururaja wrote:
> @@ -1493,6 +1544,28 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
> aic3x->setup = ai3x_setup;
> }
>
> + if (!of_property_read_u32(np, "ai3x-micbias-vg", &value)) {
> + switch (value) {
> + case 1 :
> + aic3x->micbias_vg = AIC3X_MICBIAS_2_0V;
> + break;
> + case 2 :
> + aic3x->micbias_vg = AIC3X_MICBIAS_2_5V;
> + break;
> + case 3 :
> + aic3x->micbias_vg = AIC3X_MICBIAS_AVDDV;
> + break;
> + default :
> + aic3x->micbias_vg = AIC3X_MICBIAS_OFF;
> + dev_err(&i2c->dev, "Unsuitable MicBias voltage "
> + "found in DT\n");
> + }
> + } else {
> + dev_warn(&i2c->dev, "No MicBias voltage found in DT - "
> + "using default\n");
Since "ai3x-micbias-vg" property is optional I don't think it is appropriate
to print anything here. If you really want a note about this it should be
dev_info().
> + aic3x->micbias_vg = AIC3X_MICBIAS_OFF;
> + }
> +
> } else {
> aic3x->gpio_reset = -1;
> }
> diff --git a/sound/soc/codecs/tlv320aic3x.h b/sound/soc/codecs/tlv320aic3x.h
> index 6db3c41..e521ac3 100644
> --- a/sound/soc/codecs/tlv320aic3x.h
> +++ b/sound/soc/codecs/tlv320aic3x.h
> @@ -238,6 +238,10 @@
> /* Default input volume */
> #define DEFAULT_GAIN 0x20
>
> +/* MICBIAS Control Register */
> +#define MICBIAS_LEVEL_SHIFT (6)
> +#define MICBIAS_LEVEL_MASK (3 << 6)
> +
> /* headset detection / button API */
>
> /* The AIC3x supports detection of stereo headsets (GND + left + right signal)
>
--
Péter
WARNING: multiple messages have this Message-ID (diff)
From: peter.ujfalusi@ti.com (Peter Ujfalusi)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [PATCH 1/2] ASoC: tlv320aic3x: Convert mic bias to a supply widget
Date: Thu, 31 Jan 2013 09:02:22 +0100 [thread overview]
Message-ID: <510A250E.4000706@ti.com> (raw)
In-Reply-To: <1359552155-17426-1-git-send-email-gururaja.hebbar@ti.com>
On 01/30/2013 02:22 PM, Hebbar Gururaja wrote:
> @@ -1493,6 +1544,28 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
> aic3x->setup = ai3x_setup;
> }
>
> + if (!of_property_read_u32(np, "ai3x-micbias-vg", &value)) {
> + switch (value) {
> + case 1 :
> + aic3x->micbias_vg = AIC3X_MICBIAS_2_0V;
> + break;
> + case 2 :
> + aic3x->micbias_vg = AIC3X_MICBIAS_2_5V;
> + break;
> + case 3 :
> + aic3x->micbias_vg = AIC3X_MICBIAS_AVDDV;
> + break;
> + default :
> + aic3x->micbias_vg = AIC3X_MICBIAS_OFF;
> + dev_err(&i2c->dev, "Unsuitable MicBias voltage "
> + "found in DT\n");
> + }
> + } else {
> + dev_warn(&i2c->dev, "No MicBias voltage found in DT - "
> + "using default\n");
Since "ai3x-micbias-vg" property is optional I don't think it is appropriate
to print anything here. If you really want a note about this it should be
dev_info().
> + aic3x->micbias_vg = AIC3X_MICBIAS_OFF;
> + }
> +
> } else {
> aic3x->gpio_reset = -1;
> }
> diff --git a/sound/soc/codecs/tlv320aic3x.h b/sound/soc/codecs/tlv320aic3x.h
> index 6db3c41..e521ac3 100644
> --- a/sound/soc/codecs/tlv320aic3x.h
> +++ b/sound/soc/codecs/tlv320aic3x.h
> @@ -238,6 +238,10 @@
> /* Default input volume */
> #define DEFAULT_GAIN 0x20
>
> +/* MICBIAS Control Register */
> +#define MICBIAS_LEVEL_SHIFT (6)
> +#define MICBIAS_LEVEL_MASK (3 << 6)
> +
> /* headset detection / button API */
>
> /* The AIC3x supports detection of stereo headsets (GND + left + right signal)
>
--
P?ter
next prev parent reply other threads:[~2013-01-31 8:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 13:22 [PATCH 1/2] ASoC: tlv320aic3x: Convert mic bias to a supply widget Hebbar Gururaja
2013-01-30 13:22 ` Hebbar Gururaja
2013-01-31 2:32 ` Mark Brown
2013-01-31 2:32 ` Mark Brown
2013-01-31 5:27 ` Hebbar, Gururaja
2013-01-31 5:27 ` Hebbar, Gururaja
2013-01-31 8:02 ` Peter Ujfalusi [this message]
2013-01-31 8:02 ` [alsa-devel] " Peter Ujfalusi
2013-01-31 8:23 ` Hebbar, Gururaja
2013-01-31 8:23 ` [alsa-devel] " Hebbar, Gururaja
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=510A250E.4000706@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=alsa-user@lists.sourceforge.net \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=gururaja.hebbar@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=nsekhar@ti.com \
--cc=sudhakar.raj@ti.com \
--cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.