All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org,
	Sven Neumann <s.neumann@raumfeld.com>, Liam Girdwood <lrg@ti.com>,
	Daniel Mack <daniel@zonque.org>
Subject: Re: [PATCH] ASoC: sta32x: add workaround for ESD reset issue
Date: Thu, 10 Nov 2011 15:27:08 +0100	[thread overview]
Message-ID: <20111110142708.GA12808@sig21.net> (raw)
In-Reply-To: <20111109233256.GA5010@opensource.wolfsonmicro.com>

On Wed, Nov 09, 2011 at 11:32:57PM +0000, Mark Brown wrote:
> On Wed, Nov 09, 2011 at 06:34:19PM +0100, Johannes Stezenbach wrote:
> > On Wed, Nov 09, 2011 at 02:36:47PM +0000, Mark Brown wrote:
> 
> > > Given that the driver already supports powering the device down it may
> > > also be sufficient to simply enable idle_bias_off and assume that if the
> > > device resets the application will get sufficiently upset to restart
> > > things anyway.
> 
> > Unfortunately the app won't notice, the PXA I2S interface will
> > happily push the audio data to the codec which will be muted
> > without the app knowing it since the register cache will tell
> > something different.
> 
> Yeah, but if it suddenly stops in the middle of playback then that'll
> tend to register with users and if you keep it powered off at all other
> times.

Hm, the goal is to fix the issue without user interaction.
The app will keep the device open and will play back
without noticing the problem.

> > > > +	for (i = 0; i < numcoef && (index + (i + 1) * 3 < STA32X_COEF_COUNT); i++)
> > > > +		sta32x->coef_shadow[index + i] =
> > > > +			  (ucontrol->value.bytes.data[3 * i    ] << 16)
> > > > +			| (ucontrol->value.bytes.data[3 * i + 1] << 8)
> > > > +			| (ucontrol->value.bytes.data[3 * i + 2]);
> 
> > > Does this need to be done when restoring to _STANDBY as well?
> 
> > No, all registers and coefs are preserved until hw reset or power loss.
> 
> Right, but the bias level management is disabling the regulators for the
> device so power loss may happen then and _STANDBY is also used to resume
> the device after suspend when power loss may also occur.

Ah, you're right, if the system cuts power to the sta32x during
standby we need to restore the coef RAM after resume.  How I
see where my code is buggy.  I also see what you mean about
using idle_bias_off to restore the settings, namely

	level = codec->dapm.bias_level;
	BUG_ON(level == SND_SOC_BIAS_OFF);
	sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF);
	sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
	if (level > SND_SOC_BIAS_STANDBY);
		sta32x_set_bias_level(codec, SND_SOC_BIAS_PREPARE);
	if (level > SND_SOC_BIAS_PREPARE);
		sta32x_set_bias_level(codec, SND_SOC_BIAS_ON);

Right?

I'll work on a new version of the patch and send it after
it's been put through testing by Sven.


Thanks for the review!

Johannes

  reply	other threads:[~2011-11-10 14:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 13:30 [PATCH] ASoC: sta32x: add workaround for ESD reset issue Johannes Stezenbach
2011-11-09 14:36 ` Mark Brown
2011-11-09 17:34   ` Johannes Stezenbach
2011-11-09 23:32     ` Mark Brown
2011-11-10 14:27       ` Johannes Stezenbach [this message]
2011-11-10 15:11         ` Mark Brown
2011-11-10 16:49           ` Sven Neumann

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=20111110142708.GA12808@sig21.net \
    --to=js@sig21.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=daniel@zonque.org \
    --cc=lrg@ti.com \
    --cc=s.neumann@raumfeld.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.