aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorGraeme Gregory <graeme@openmoko.com>2008-01-10 08:44:58 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:51 -0500
commit5cd919a2144f1beee7fb2e18ef6b8bee7105f554 (patch)
tree821b9d444c72bb81053a9eb7c92acc5b7008bb71 /sound/soc
parent96d90e19307ce590097295026a2e1b36618ddd01 (diff)
[ALSA] soc - Support suspend and resume of the I2S interface on s3c24xx
Signed-off-by: Graeme Gregory <graeme@openmoko.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/s3c24xx/s3c24xx-i2s.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index ff99b76e71a4..0a3c630951be 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -76,6 +76,10 @@ static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_in = {
76struct s3c24xx_i2s_info { 76struct s3c24xx_i2s_info {
77 void __iomem *regs; 77 void __iomem *regs;
78 struct clk *iis_clk; 78 struct clk *iis_clk;
79 u32 iiscon;
80 u32 iismod;
81 u32 iisfcon;
82 u32 iispsr;
79}; 83};
80static struct s3c24xx_i2s_info s3c24xx_i2s; 84static struct s3c24xx_i2s_info s3c24xx_i2s;
81 85
@@ -406,6 +410,38 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev)
406 return 0; 410 return 0;
407} 411}
408 412
413#ifdef CONFIG_PM
414int s3c24xx_i2s_suspend(struct platform_device *pdev,
415 struct snd_soc_cpu_dai *cpu_dai)
416{
417 s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
418 s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
419 s3c24xx_i2s.iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
420 s3c24xx_i2s.iispsr = readl(s3c24xx_i2s.regs + S3C2410_IISPSR);
421
422 clk_disable(s3c24xx_i2s.iis_clk);
423
424 return 0;
425}
426
427int s3c24xx_i2s_resume(struct platform_device *pdev,
428 struct snd_soc_cpu_dai *cpu_dai)
429{
430 clk_enable(s3c24xx_i2s.iis_clk);
431
432 writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
433 writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
434 writel(s3c24xx_i2s.iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON);
435 writel(s3c24xx_i2s.iispsr, s3c24xx_i2s.regs + S3C2410_IISPSR);
436
437 return 0;
438}
439#else
440#define s3c24xx_i2s_suspend NULL
441#define s3c24xx_i2s_resume NULL
442#endif
443
444
409#define S3C24XX_I2S_RATES \ 445#define S3C24XX_I2S_RATES \
410 (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \ 446 (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
411 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ 447 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
@@ -416,6 +452,8 @@ struct snd_soc_cpu_dai s3c24xx_i2s_dai = {
416 .id = 0, 452 .id = 0,
417 .type = SND_SOC_DAI_I2S, 453 .type = SND_SOC_DAI_I2S,
418 .probe = s3c24xx_i2s_probe, 454 .probe = s3c24xx_i2s_probe,
455 .suspend = s3c24xx_i2s_suspend,
456 .resume = s3c24xx_i2s_resume,
419 .playback = { 457 .playback = {
420 .channels_min = 2, 458 .channels_min = 2,
421 .channels_max = 2, 459 .channels_max = 2,