Title: [9172] trunk/sound/soc/codecs/ssm2602.c: [#6269] ssm2602: save/restore power state during suspend/resume.
Revision
9172
Author
lliubbo
Date
2010-09-27 00:10:39 -0400 (Mon, 27 Sep 2010)

Log Message

[#6269] ssm2602: 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/ssm2602.c (9171 => 9172)


--- trunk/sound/soc/codecs/ssm2602.c	2010-09-25 10:32:38 UTC (rev 9171)
+++ trunk/sound/soc/codecs/ssm2602.c	2010-09-27 04:10:39 UTC (rev 9172)
@@ -49,6 +49,7 @@
 static struct snd_soc_codec *ssm2602_codec;
 /* codec private data */
 struct ssm2602_priv {
+	u16 pwr_state;
 	unsigned int sysclk;
 	struct snd_soc_codec codec;
 };
@@ -440,7 +441,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);
 	ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
 	return 0;
 }
@@ -449,6 +452,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;
@@ -461,6 +465,7 @@
 	}
 	ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 	ssm2602_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

Reply via email to