All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 2/4] ASoC: tlv320aic3x: Add runtime regulator control to aic3x_set_bias_level
Date: Fri, 10 Sep 2010 15:18:27 +0300	[thread overview]
Message-ID: <20100910151827.debce417.jhnikula@gmail.com> (raw)
In-Reply-To: <20100910114717.GI7259@rakim.wolfsonmicro.main>

On Fri, 10 Sep 2010 12:47:17 +0100
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> On Fri, Sep 10, 2010 at 02:23:30PM +0300, Jarkko Nikula wrote:
> 
> > This patch manages all the regulators and reset since it seems that register
> > sync is needed even if only analog supplies AVDD and DRVDD are disabled.
> > This was noted when the system was running with idle behavior changed and
> > IOVDD and DVDD were on.
> 
> This is normal, chips normally require all the core supplies to be
> enabled to take them out of reset.
> 
Some chips were programmable with digital IO supply only. I'll leave
this comment here to show that this chip has been noted to require all
of them :-)

> > @@ -151,7 +153,8 @@ static int aic3x_write(struct snd_soc_codec *codec, unsigned int reg,
> >  	data[1] = value & 0xff;
> >  
> >  	aic3x_write_reg_cache(codec, data[0], data[1]);
> > -	if (codec->hw_write(codec->control_data, data, 2) == 2)
> > +	if (!aic3x->power ||
> > +	    codec->hw_write(codec->control_data, data, 2) == 2)
> >  		return 0;
> >  	else
> >  		return -EIO;
> 
> If you were using the soc-core stuff you'd be able to use the cache_only
> flag in the CODEC to do this.  It might make sense to still use the flag
> so that when someone converts the driver to use soc-cache this doesn't
> get missed.
> 
Makes sense, I'll change this.

> >  static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg,
> >  		      u8 *value)
> >  {
> > +	struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
> >  	*value = reg & 0xff;
> >  
> > -	value[0] = i2c_smbus_read_byte_data(codec->control_data, value[0]);
> > +	if (aic3x->power) {
> > +		value[0] = i2c_smbus_read_byte_data(codec->control_data,
> > +						    value[0]);
> > +		aic3x_write_reg_cache(codec, reg, *value);
> > +	} else {
> > +		value[0] = aic3x_read_reg_cache(codec, reg);
> > +	}
> >  
> > -	aic3x_write_reg_cache(codec, reg, *value);
> >  	return 0;
> >  }
> 
> This seems fishy - surely the read should be being satisfied from cache
> all the time if it can be, and if the register does need to be read from
> the hardware due to being volatile then it's an error to read it while
> powered off?

Good question. I didn't look at this. Actually it seems there is a need
to add some function to indicate if headset & button detection or gpio
readings are required. We cannot shutdown if those are needed.


-- 
Jarkko

  reply	other threads:[~2010-09-10 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 11:23 [PATCH 1/4] ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level Jarkko Nikula
2010-09-10 11:23 ` [PATCH 2/4] ASoC: tlv320aic3x: Add runtime regulator control to aic3x_set_bias_level Jarkko Nikula
2010-09-10 11:47   ` Mark Brown
2010-09-10 12:18     ` Jarkko Nikula [this message]
2010-09-10 11:23 ` [PATCH 3/4] ASoC: tlv320aic3x: Use regulator notifiers for optimizing the cache sync Jarkko Nikula
2010-09-10 11:58   ` Mark Brown
2010-09-10 12:33     ` Jarkko Nikula
2010-09-10 11:23 ` [PATCH 4/4] ASoC: tlv320aic3x: Let the codec hit SND_SOC_BIAS_OFF when idle Jarkko Nikula
2010-09-10 12:00   ` Mark Brown
2010-09-10 12:42     ` Jarkko Nikula
2010-09-10 11:36 ` [PATCH 1/4] ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level Mark Brown
2010-09-11  8:04   ` Liam Girdwood

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=20100910151827.debce417.jhnikula@gmail.com \
    --to=jhnikula@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    /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.