aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ac97.c')
-rw-r--r--sound/soc/codecs/ac97.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 2a1ffe396908..61fd96ca7bc7 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -10,9 +10,6 @@
10 * Free Software Foundation; either version 2 of the License, or (at your 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
12 * 12 *
13 * Revision history
14 * 17th Oct 2005 Initial version.
15 *
16 * Generic AC97 support. 13 * Generic AC97 support.
17 */ 14 */
18 15
@@ -24,6 +21,7 @@
24#include <sound/ac97_codec.h> 21#include <sound/ac97_codec.h>
25#include <sound/initval.h> 22#include <sound/initval.h>
26#include <sound/soc.h> 23#include <sound/soc.h>
24#include "ac97.h"
27 25
28#define AC97_VERSION "0.6" 26#define AC97_VERSION "0.6"
29 27
@@ -43,7 +41,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream)
43 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ 41 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
44 SNDRV_PCM_RATE_48000) 42 SNDRV_PCM_RATE_48000)
45 43
46struct snd_soc_codec_dai ac97_dai = { 44struct snd_soc_dai ac97_dai = {
47 .name = "AC97 HiFi", 45 .name = "AC97 HiFi",
48 .type = SND_SOC_DAI_AC97, 46 .type = SND_SOC_DAI_AC97,
49 .playback = { 47 .playback = {
@@ -146,9 +144,34 @@ static int ac97_soc_remove(struct platform_device *pdev)
146 return 0; 144 return 0;
147} 145}
148 146
147#ifdef CONFIG_PM
148static int ac97_soc_suspend(struct platform_device *pdev, pm_message_t msg)
149{
150 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
151
152 snd_ac97_suspend(socdev->codec->ac97);
153
154 return 0;
155}
156
157static int ac97_soc_resume(struct platform_device *pdev)
158{
159 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
160
161 snd_ac97_resume(socdev->codec->ac97);
162
163 return 0;
164}
165#else
166#define ac97_soc_suspend NULL
167#define ac97_soc_resume NULL
168#endif
169
149struct snd_soc_codec_device soc_codec_dev_ac97 = { 170struct snd_soc_codec_device soc_codec_dev_ac97 = {
150 .probe = ac97_soc_probe, 171 .probe = ac97_soc_probe,
151 .remove = ac97_soc_remove, 172 .remove = ac97_soc_remove,
173 .suspend = ac97_soc_suspend,
174 .resume = ac97_soc_resume,
152}; 175};
153EXPORT_SYMBOL_GPL(soc_codec_dev_ac97); 176EXPORT_SYMBOL_GPL(soc_codec_dev_ac97);
154 177