Title: [9173] trunk/sound/soc/codecs/ssm2604.c: [#6269] ssm2604: save/restore power state during suspend/resume.
- Revision
- 9173
- Author
- lliubbo
- Date
- 2010-09-27 00:11:10 -0400 (Mon, 27 Sep 2010)
Log Message
[#6269] ssm2604: save/restore power state during suspend/resume.
The current function can't save and restore the power state correctly
during suspend, so after resume there will be input/output error.
This commit add save/restore the power state.
Modified Paths
Diff
Modified: trunk/sound/soc/codecs/ssm2604.c (9172 => 9173)
--- trunk/sound/soc/codecs/ssm2604.c 2010-09-27 04:10:39 UTC (rev 9172)
+++ trunk/sound/soc/codecs/ssm2604.c 2010-09-27 04:11:10 UTC (rev 9173)
@@ -30,6 +30,7 @@
/* codec private data */
struct ssm2604_priv {
unsigned int sysclk;
+ u16 pwr_state;
struct snd_pcm_substream *master_substream;
struct snd_pcm_substream *slave_substream;
struct snd_soc_codec codec;
@@ -438,7 +439,9 @@
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_codec *codec = socdev->card->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ ssm2602->pwr_state = snd_soc_read(codec, SSM2602_PWR);
ssm2604_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}
@@ -447,6 +450,7 @@
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_codec *codec = socdev->card->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
int i;
u8 data[2];
u16 *cache = codec->reg_cache;
@@ -459,6 +463,7 @@
}
ssm2604_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
ssm2604_set_bias_level(codec, codec->suspend_bias_level);
+ snd_soc_write(codec, SSM2602_PWR, ssm2602->pwr_state);
return 0;
}
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits