All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] codecs/tlv320aic23: fix suspend/resume
@ 2010-06-19  8:56 Eric Bénard
  2010-06-19 10:59 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2010-06-19  8:56 UTC (permalink / raw)
  To: alsa-devel; +Cc: anuj.aggarwal, broonie, Eric Bénard, lrg

The PWR register actually can't be restored at resume because its
cached value was set to 0xFFFF when suspending and thus the initial
state won't be restored. Thus, sound doesn't work after resume (tested
on an i.MX27).

To workaround this, this patch saves the PWR value before turning
the codec's power off and store this value in the cached registers.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Cc: broonie@opensource.wolfsonmicro.com
Cc: anuj.aggarwal@ti.com
Cc: lrg@slimlogic.co.uk
---
 sound/soc/codecs/tlv320aic23.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index b0bae35..75e320b 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -614,9 +614,15 @@ static int tlv320aic23_suspend(struct platform_device *pdev,
 {
 	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
 	struct snd_soc_codec *codec = socdev->card->codec;
+	u16 tmp;
 
 	tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x0);
+	/* backup PWR register */
+	tmp = tlv320aic23_read_reg_cache(codec, TLV320AIC23_PWR);
+	/* turn off the codec */
 	tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_OFF);
+	/* restore PWR register in the cache */
+	tlv320aic23_write_reg_cache(codec, TLV320AIC23_PWR, tmp);
 
 	return 0;
 }
@@ -633,8 +639,6 @@ static int tlv320aic23_resume(struct platform_device *pdev)
 		tlv320aic23_write(codec, reg, val);
 	}
 
-	tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	return 0;
 }
 
-- 
1.6.3.3

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2010-06-23 10:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-19  8:56 [PATCH] codecs/tlv320aic23: fix suspend/resume Eric Bénard
2010-06-19 10:59 ` Mark Brown
2010-06-19 12:07   ` Eric Bénard
2010-06-19 17:33   ` [PATCH v2] codecs/tlv320aic23: fix bias management for suspend/resume Eric Bénard
2010-06-22 10:07     ` Liam Girdwood
2010-06-22 23:17     ` Mark Brown
2010-06-23 10:35       ` 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.