From: "Eric Bénard" <eric@eukrea.com>
To: alsa-devel@alsa-project.org
Cc: anuj.aggarwal@ti.com, broonie@opensource.wolfsonmicro.com,
"Eric Bénard" <eric@eukrea.com>,
lrg@slimlogic.co.uk
Subject: [PATCH] codecs/tlv320aic23: fix suspend/resume
Date: Sat, 19 Jun 2010 10:56:54 +0200 [thread overview]
Message-ID: <1276937814-10510-1-git-send-email-eric@eukrea.com> (raw)
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
next reply other threads:[~2010-06-19 8:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-19 8:56 Eric Bénard [this message]
2010-06-19 10:59 ` [PATCH] codecs/tlv320aic23: fix suspend/resume 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
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=1276937814-10510-1-git-send-email-eric@eukrea.com \
--to=eric@eukrea.com \
--cc=alsa-devel@alsa-project.org \
--cc=anuj.aggarwal@ti.com \
--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.