alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] ASoC: max98090: read micbias from device property
@ 2015-05-27 21:35 Anish Kumar
  2015-05-27 23:40 ` Yang Fang
  0 siblings, 1 reply; 6+ messages in thread
From: Anish Kumar @ 2015-05-27 21:35 UTC (permalink / raw)
  To: yang.a.fang, broonie
  Cc: alsa-devel, srinivas.sripathi, praveen.k.jain, lgirdwood,
	denny.iriawan, sathyanarayana.nujella, kevin.strasser

> From: "Fang, Yang A" <yang.a.fang@intel.com>
>
> This patch reads max98090 micbias from acpi or dt
>
> Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
> ---
>  sound/soc/codecs/max98090.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
> index c230626..27df17e 100644
> --- a/sound/soc/codecs/max98090.c
> +++ b/sound/soc/codecs/max98090.c
> @@ -2419,6 +2419,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
>         struct max98090_cdata *cdata;
>         enum max98090_type devtype;
>         int ret = 0;
> +       int err;
> +       unsigned int micbias;
>
>         dev_dbg(codec->dev, "max98090_probe\n");
>
> @@ -2503,8 +2505,13 @@ static int max98090_probe(struct snd_soc_codec *codec)
>         snd_soc_write(codec, M98090_REG_BIAS_CONTROL,
>                 M98090_VCM_MODE_MASK);
>
> +       err = device_property_read_u32(codec->dev, "max,micbias", &micbias);

            if (err || micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8)
                 micbias = M98090_MBVSEL_2V8;
Just stick sanity as well.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] ASoC: max98090: read micbias from device property
  2015-05-27 21:35 [PATCH 1/3] ASoC: max98090: read micbias from device property Anish Kumar
@ 2015-05-27 23:40 ` Yang Fang
  0 siblings, 0 replies; 6+ messages in thread
From: Yang Fang @ 2015-05-27 23:40 UTC (permalink / raw)
  To: Anish Kumar
  Cc: alsa-devel, srinivas.sripathi, praveen.k.jain, lgirdwood,
	denny.iriawan, broonie, sathyanarayana.nujella, kevin.strasser

On Wed, May 27, 2015 at 02:35:40PM -0700, Anish Kumar wrote:
> > From: "Fang, Yang A" <yang.a.fang@intel.com>
> >
> > This patch reads max98090 micbias from acpi or dt
> >
> > Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
> > ---
> >  sound/soc/codecs/max98090.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
> > index c230626..27df17e 100644
> > --- a/sound/soc/codecs/max98090.c
> > +++ b/sound/soc/codecs/max98090.c
> > @@ -2419,6 +2419,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
> >         struct max98090_cdata *cdata;
> >         enum max98090_type devtype;
> >         int ret = 0;
> > +       int err;
> > +       unsigned int micbias;
> >
> >         dev_dbg(codec->dev, "max98090_probe\n");
> >
> > @@ -2503,8 +2505,13 @@ static int max98090_probe(struct snd_soc_codec *codec)
> >         snd_soc_write(codec, M98090_REG_BIAS_CONTROL,
> >                 M98090_VCM_MODE_MASK);
> >
> > +       err = device_property_read_u32(codec->dev, "max,micbias", &micbias);
> 
>             if (err || micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8)
>                  micbias = M98090_MBVSEL_2V8;
> Just stick sanity as well.
thanks.will include in v2. waiting for more comments

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] ASoC: max98090: read micbias from device property
  2015-05-26 23:58 yang.a.fang
  2015-05-27  4:39 ` Dylan Reid
@ 2015-05-28  9:28 ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2015-05-28  9:28 UTC (permalink / raw)
  To: yang.a.fang
  Cc: alsa-devel, srinivas.sripathi, praveen.k.jain, lgirdwood,
	denny.iriawan, sathyanarayana.nujella, kevin.strasser, dgreid


[-- Attachment #1.1: Type: text/plain, Size: 252 bytes --]

On Tue, May 26, 2015 at 04:58:04PM -0700, yang.a.fang@intel.com wrote:
> From: "Fang, Yang A" <yang.a.fang@intel.com>
> 
> This patch reads max98090 micbias from acpi or dt

This is adding a new DT binding, the DT binding needs to be documented.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] ASoC: max98090: read micbias from device property
  2015-05-27  4:39 ` Dylan Reid
@ 2015-05-27 17:26   ` Yang Fang
  0 siblings, 0 replies; 6+ messages in thread
From: Yang Fang @ 2015-05-27 17:26 UTC (permalink / raw)
  To: Dylan Reid
  Cc: alsa-devel, Sripathi, Srinivas, Praveen K Jain, Liam Girdwood,
	Denny Iriawan, Mark Brown, Nujella, Sathyanarayana,
	kevin.strasser

On Tue, May 26, 2015 at 09:39:54PM -0700, Dylan Reid wrote:
> On Tue, May 26, 2015 at 4:58 PM,  <yang.a.fang@intel.com> wrote:
> > From: "Fang, Yang A" <yang.a.fang@intel.com>
> >
> > This patch reads max98090 micbias from acpi or dt
> >
> > Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
> > ---
> >  sound/soc/codecs/max98090.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
> > index c230626..27df17e 100644
> > --- a/sound/soc/codecs/max98090.c
> > +++ b/sound/soc/codecs/max98090.c
> > @@ -2419,6 +2419,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
> >         struct max98090_cdata *cdata;
> >         enum max98090_type devtype;
> >         int ret = 0;
> > +       int err;
> > +       unsigned int micbias;
> >
> >         dev_dbg(codec->dev, "max98090_probe\n");
> >
> > @@ -2503,8 +2505,13 @@ static int max98090_probe(struct snd_soc_codec *codec)
> >         snd_soc_write(codec, M98090_REG_BIAS_CONTROL,
> >                 M98090_VCM_MODE_MASK);
> >
> > +       err = device_property_read_u32(codec->dev, "max,micbias", &micbias);
> 
> Should this be "maxim,micbias" to be consistent with  "maxim,dmic-freq"?
> It should also be added to the Documentation for the max98090, as an
> optional parameter.
Agreed . i will change it in v2 and update the Documentation
> 
> > +
> 
> Extra newline.
will fix in v2
> 
> > +       if (err)
> > +               micbias = M98090_MBVSEL_2V8;
> > +
> >         snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
> > -               M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);
> > +               M98090_MBVSEL_MASK, micbias);
> >
> >         max98090_add_widgets(codec);
> >
> > --
> > 1.7.9.5
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] ASoC: max98090: read micbias from device property
  2015-05-26 23:58 yang.a.fang
@ 2015-05-27  4:39 ` Dylan Reid
  2015-05-27 17:26   ` Yang Fang
  2015-05-28  9:28 ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Dylan Reid @ 2015-05-27  4:39 UTC (permalink / raw)
  To: Yang Fang
  Cc: alsa-devel, Sripathi, Srinivas, Praveen K Jain, Liam Girdwood,
	Denny Iriawan, Mark Brown, Nujella, Sathyanarayana,
	kevin.strasser

On Tue, May 26, 2015 at 4:58 PM,  <yang.a.fang@intel.com> wrote:
> From: "Fang, Yang A" <yang.a.fang@intel.com>
>
> This patch reads max98090 micbias from acpi or dt
>
> Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
> ---
>  sound/soc/codecs/max98090.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
> index c230626..27df17e 100644
> --- a/sound/soc/codecs/max98090.c
> +++ b/sound/soc/codecs/max98090.c
> @@ -2419,6 +2419,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
>         struct max98090_cdata *cdata;
>         enum max98090_type devtype;
>         int ret = 0;
> +       int err;
> +       unsigned int micbias;
>
>         dev_dbg(codec->dev, "max98090_probe\n");
>
> @@ -2503,8 +2505,13 @@ static int max98090_probe(struct snd_soc_codec *codec)
>         snd_soc_write(codec, M98090_REG_BIAS_CONTROL,
>                 M98090_VCM_MODE_MASK);
>
> +       err = device_property_read_u32(codec->dev, "max,micbias", &micbias);

Should this be "maxim,micbias" to be consistent with  "maxim,dmic-freq"?
It should also be added to the Documentation for the max98090, as an
optional parameter.

> +

Extra newline.

> +       if (err)
> +               micbias = M98090_MBVSEL_2V8;
> +
>         snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
> -               M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);
> +               M98090_MBVSEL_MASK, micbias);
>
>         max98090_add_widgets(codec);
>
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] ASoC: max98090: read micbias from device property
@ 2015-05-26 23:58 yang.a.fang
  2015-05-27  4:39 ` Dylan Reid
  2015-05-28  9:28 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: yang.a.fang @ 2015-05-26 23:58 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: alsa-devel, srinivas.sripathi, Fang, Yang A, praveen.k.jain,
	denny.iriawan, sathyanarayana.nujella, kevin.strasser, dgreid

From: "Fang, Yang A" <yang.a.fang@intel.com>

This patch reads max98090 micbias from acpi or dt

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
---
 sound/soc/codecs/max98090.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index c230626..27df17e 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2419,6 +2419,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
 	struct max98090_cdata *cdata;
 	enum max98090_type devtype;
 	int ret = 0;
+	int err;
+	unsigned int micbias;
 
 	dev_dbg(codec->dev, "max98090_probe\n");
 
@@ -2503,8 +2505,13 @@ static int max98090_probe(struct snd_soc_codec *codec)
 	snd_soc_write(codec, M98090_REG_BIAS_CONTROL,
 		M98090_VCM_MODE_MASK);
 
+	err = device_property_read_u32(codec->dev, "max,micbias", &micbias);
+
+	if (err)
+		micbias = M98090_MBVSEL_2V8;
+
 	snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
-		M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);
+		M98090_MBVSEL_MASK, micbias);
 
 	max98090_add_widgets(codec);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-28  9:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 21:35 [PATCH 1/3] ASoC: max98090: read micbias from device property Anish Kumar
2015-05-27 23:40 ` Yang Fang
  -- strict thread matches above, loose matches on Subject: below --
2015-05-26 23:58 yang.a.fang
2015-05-27  4:39 ` Dylan Reid
2015-05-27 17:26   ` Yang Fang
2015-05-28  9:28 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).