From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Aggarwal, Anuj" <anuj.aggarwal@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] ASoC: AM3517: Fix AIC23 suspend/resume hang
Date: Wed, 25 Nov 2009 19:39:34 +0000 [thread overview]
Message-ID: <20091125193934.GA9263@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB030AAC2F77@dbde02.ent.ti.com>
On Thu, Nov 26, 2009 at 12:49:11AM +0530, Aggarwal, Anuj wrote:
> <snip>
> int i;
> u16 reg;
>
> /* Sync reg_cache with the hardware */
> for (reg = 0; reg < ARRAY_SIZE(tlv320aic23_reg); i++) {
> u16 val = tlv320aic23_read_reg_cache(codec, reg);
> tlv320aic23_write(codec, reg, val);
> }
> </snip>
> I can see 'i' getting incremented, instead of 'reg'. Isn't this an
> infinite loop?
Yes, that does look entirely buggy - it seems fairly clear that suspend
and resume have never worked with this driver. The fact that you were
removing the loop entirely meant I didn't read the actual code for bugs.
> > > This patch fixes the problem by correcting the resume path and
> > > properly activating/deactivating the digital interface while
> > > doing the suspend / off transitions.
> > What do you mean by "properly activating/deactivating the digital
> > interface"?
> [Aggarwal, Anuj] The driver was only deactivating the digital
> interface and not activating it. Hence added that part.
So this is a separate issue, and should ideally be a separate patch - it
looks like you've got three different changes here, one to fix the buggy
register cache restore, one to manage the PWR bit on suspend and another
to possibly fix the bias configuration. You certainly need to identify
all three changes in the changelog, especially for things like this
which look like they should go in as bug fixes (and bearing in mind that
it's the end of the release cycle).
Glancing at the code there's much more management required here -
there's other places where it's managed and the code needs to be joined
up with them. The setting should only be restored if the device was
active when suspended, not unconditionally.
> > > case SND_SOC_BIAS_STANDBY:
> > > - /* everything off except vref/vmid, */
> > > - tlv320aic23_write(codec, TLV320AIC23_PWR, reg | 0x0040);
> > > + /* Activate the digital interface */
> > > + tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x1);
> > > break;
> > > case SND_SOC_BIAS_OFF:
> > > - /* everything off, dac mute, inactive */
> > > + /* Deactivate the digital interface */
> > > tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x0);
> > > - tlv320aic23_write(codec, TLV320AIC23_PWR, 0xffff);
> > > break;
> >
> > This looks wrong - the driver is now no longer managing bias levels at
> > all.
> [Aggarwal, Anuj] The bias levels were wrongly managed earlier. While doing
> a suspend, it was powering off all the interfaces and while coming up, it
> was not switching on the required interfaces. Hence no sound was coming
> out if audio was played back.
Note that this CODEC driver impelements DAPM and so all the bits in the
power register which are controlled by DAPM will be managed by the ASoC
core without any action by the driver.
> On each bias level, which are the interfaces which need to be switched
> on / off?
The biases and any other device-wide settings, everything else should be
managed via DAPM if it's in use.
next prev parent reply other threads:[~2009-11-25 19:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 13:10 [PATCH] ASoC: AM3517: Fix AIC23 suspend/resume hang Anuj Aggarwal
2009-11-25 13:33 ` Mark Brown
2009-11-25 19:19 ` Aggarwal, Anuj
2009-11-25 19:39 ` Mark Brown [this message]
2009-11-26 3:19 ` Aggarwal, Anuj
2009-11-25 20:22 ` Troy Kisky
2009-11-26 3:01 ` Aggarwal, Anuj
2009-11-26 10:22 ` [alsa-devel] " Mark Brown
2009-11-26 14:56 ` Aggarwal, Anuj
2009-11-26 15:11 ` Mark Brown
2009-11-26 15:22 ` Aggarwal, Anuj
2009-11-26 15:24 ` Aggarwal, Anuj
2009-11-26 15:29 ` Mark Brown
2009-11-27 8:07 ` Aggarwal, Anuj
2009-11-27 11:42 ` [alsa-devel] " Mark Brown
2009-11-27 11:47 ` Mark Brown
2009-11-26 15:42 ` Philby John
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=20091125193934.GA9263@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=anuj.aggarwal@ti.com \
--cc=linux-omap@vger.kernel.org \
/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