All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache
@ 2011-05-20 13:52 Jarkko Nikula
  2011-05-20 13:52 ` [PATCH 2/2] ASoC: tlv320aic3x: Do soft reset to codec when going to bias off state Jarkko Nikula
  2011-05-21 15:30 ` [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Liam Girdwood
  0 siblings, 2 replies; 5+ messages in thread
From: Jarkko Nikula @ 2011-05-20 13:52 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood

There is no need to sync first two registers from cache to hw after a reset.
First one is used to select page for register access and this driver is
normally accessing page 0 only. Second one does a software reset which is
obviously unneeded after hardware or previous software reset command.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
 sound/soc/codecs/tlv320aic3x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index c3d96fc..9047bb1 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1114,7 +1114,7 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
 
 		/* Sync reg_cache with the hardware */
 		codec->cache_only = 0;
-		for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++)
+		for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++)
 			snd_soc_write(codec, i, cache[i]);
 		if (aic3x->model == AIC3X_MODEL_3007)
 			aic3x_init_3007(codec);
-- 
1.7.4.4

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

* [PATCH 2/2] ASoC: tlv320aic3x: Do soft reset to codec when going to bias off state
  2011-05-20 13:52 [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Jarkko Nikula
@ 2011-05-20 13:52 ` Jarkko Nikula
  2011-05-21 15:30 ` [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Liam Girdwood
  1 sibling, 0 replies; 5+ messages in thread
From: Jarkko Nikula @ 2011-05-20 13:52 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood

TLV320AIC33, TLV320AIC34 and I believe others too in this family have some
hw bugs that cause that analogue and digital VDD supplies remain leaking
up to a few mA of current after certain use cases even the hw blocks inside
codec are driven to off.

Highest leakages occur after using the bypass paths inside codec but it
is possible to get smaller leakages just by toggling mute switches in
unused audio paths (i.e. no DAPM changes) while codec is on due another
active audio path.

While some cases are able to workaroud by making sure that e.g. output mixer
switches are muted before powering down the output stage this doesn't help
all the cases.

Therefore use the software reset command to clear possible leakage currents
since that works in every cases and affects only this codec instance. Only
drawback is that now cache sync is required everytime when codec bias comes
out from bias off state, not only when supply regulators were off.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
 sound/soc/codecs/tlv320aic3x.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 9047bb1..789453d 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1120,6 +1120,13 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
 			aic3x_init_3007(codec);
 		codec->cache_sync = 0;
 	} else {
+		/*
+		 * Do soft reset to this codec instance in order to clear
+		 * possible VDD leakage currents in case the supply regulators
+		 * remain on
+		 */
+		snd_soc_write(codec, AIC3X_RESET, SOFT_RESET);
+		codec->cache_sync = 1;
 		aic3x->power = 0;
 		/* HW writes are needless when bias is off */
 		codec->cache_only = 1;
-- 
1.7.4.4

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

* Re: [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache
  2011-05-20 13:52 [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Jarkko Nikula
  2011-05-20 13:52 ` [PATCH 2/2] ASoC: tlv320aic3x: Do soft reset to codec when going to bias off state Jarkko Nikula
@ 2011-05-21 15:30 ` Liam Girdwood
  2011-05-22 10:21   ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Liam Girdwood @ 2011-05-21 15:30 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: alsa-devel, Mark Brown

On 20/05/11 14:52, Jarkko Nikula wrote:
> There is no need to sync first two registers from cache to hw after a reset.
> First one is used to select page for register access and this driver is
> normally accessing page 0 only. Second one does a software reset which is
> obviously unneeded after hardware or previous software reset command.
> 
> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
> ---
>  sound/soc/codecs/tlv320aic3x.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 

Both

Acked-by: Liam Girdwood <lrg@ti.com>

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

* Re: [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache
  2011-05-21 15:30 ` [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Liam Girdwood
@ 2011-05-22 10:21   ` Mark Brown
  2011-05-23  9:39     ` Liam Girdwood
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-05-22 10:21 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel

On Sat, May 21, 2011 at 04:30:50PM +0100, Liam Girdwood wrote:

> Both

> Acked-by: Liam Girdwood <lrg@ti.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

As they're TI devices I guess you'd want to apply them?

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

* Re: [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache
  2011-05-22 10:21   ` Mark Brown
@ 2011-05-23  9:39     ` Liam Girdwood
  0 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-05-23  9:39 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

On 22/05/11 11:21, Mark Brown wrote:
> On Sat, May 21, 2011 at 04:30:50PM +0100, Liam Girdwood wrote:
> 
>> Both
> 
>> Acked-by: Liam Girdwood <lrg@ti.com>
> 
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> 
> As they're TI devices I guess you'd want to apply them?

Yep, both now applied.

Thanks

Liam

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

end of thread, other threads:[~2011-05-23  9:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 13:52 [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Jarkko Nikula
2011-05-20 13:52 ` [PATCH 2/2] ASoC: tlv320aic3x: Do soft reset to codec when going to bias off state Jarkko Nikula
2011-05-21 15:30 ` [PATCH 1/2] ASoC: tlv320aic3x: Don't sync first two registers from register cache Liam Girdwood
2011-05-22 10:21   ` Mark Brown
2011-05-23  9:39     ` Liam Girdwood

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.