diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-31 18:16:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-31 18:16:28 -0500 |
commit | e1a9c9872dd004617555dff079b357a6ffd945e9 (patch) | |
tree | c34779e59712ff345f8e4ee97e74086a85b34974 /sound/soc/s3c24xx/s3c24xx-i2s.c | |
parent | fcc3ff4f9d695a80dc6e6058e0d631a3026ed4c3 (diff) | |
parent | 2ecba4ffbbc6c85fce8c3878514be415edace413 (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa: (299 commits)
[ALSA] version 1.0.16rc2
[ALSA] hda: fix Mic in as output
[ALSA] emu10k1 - Another EMU0404 Board ID
[ALSA] emu10k1 - Fix kthread handling at resume
[ALSA] emu10k1: General cleanup, add new locks, fix alsa bug#3501, kernel bug#9304.
[ALSA] emu10k1 - Use enum for emu_model types
[ALSA] emu10k1 - Don't create emu1010 controls for non-emu boards
[ALSA] emu10k1 - 1616(M) cardbus improvements
[ALSA] snd:emu10k1: E-Mu updates. Fixes to firmware loading and support for 0404.
[ALSA] emu10k1: Add comments regarding E-Mu ins and outs.
[ALSA] oxygen: revert SPI clock frequency change for AK4396/WM8785
[ALSA] es1938 - improve capture hw pointer reads
[ALSA] HDA-Intel - Add support for Intel SCH
[ALSA] hda: Add GPIO mute support to STAC9205
[ALSA] hda-codec - Add Dell T3400 support
[ALSA] hda-codec - Add model for HP DV9553EG laptop
[ALSA] hda-codec - Control SPDIF as slave
[ALSA] hda_intel: ALSA HD Audio patch for Intel ICH10 DeviceID's
[ALSA] Fix Oops with PCM OSS sync
[ALSA] hda-codec - Add speaker automute to ALC262 HP models
...
Diffstat (limited to 'sound/soc/s3c24xx/s3c24xx-i2s.c')
-rw-r--r-- | sound/soc/s3c24xx/s3c24xx-i2s.c | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c index cd89c4105fcd..0a3c630951be 100644 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <sound/driver.h> | 27 | #include <linux/jiffies.h> |
28 | #include <sound/core.h> | 28 | #include <sound/core.h> |
29 | #include <sound/pcm.h> | 29 | #include <sound/pcm.h> |
30 | #include <sound/pcm_params.h> | 30 | #include <sound/pcm_params.h> |
@@ -33,13 +33,14 @@ | |||
33 | 33 | ||
34 | #include <asm/hardware.h> | 34 | #include <asm/hardware.h> |
35 | #include <asm/io.h> | 35 | #include <asm/io.h> |
36 | #include <asm/arch/regs-iis.h> | ||
37 | #include <asm/arch/regs-gpio.h> | 36 | #include <asm/arch/regs-gpio.h> |
38 | #include <asm/arch/regs-clock.h> | 37 | #include <asm/arch/regs-clock.h> |
39 | #include <asm/arch/audio.h> | 38 | #include <asm/arch/audio.h> |
40 | #include <asm/dma.h> | 39 | #include <asm/dma.h> |
41 | #include <asm/arch/dma.h> | 40 | #include <asm/arch/dma.h> |
42 | 41 | ||
42 | #include <asm/plat-s3c24xx/regs-iis.h> | ||
43 | |||
43 | #include "s3c24xx-pcm.h" | 44 | #include "s3c24xx-pcm.h" |
44 | #include "s3c24xx-i2s.h" | 45 | #include "s3c24xx-i2s.h" |
45 | 46 | ||
@@ -75,6 +76,10 @@ static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_in = { | |||
75 | struct s3c24xx_i2s_info { | 76 | struct s3c24xx_i2s_info { |
76 | void __iomem *regs; | 77 | void __iomem *regs; |
77 | struct clk *iis_clk; | 78 | struct clk *iis_clk; |
79 | u32 iiscon; | ||
80 | u32 iismod; | ||
81 | u32 iisfcon; | ||
82 | u32 iispsr; | ||
78 | }; | 83 | }; |
79 | static struct s3c24xx_i2s_info s3c24xx_i2s; | 84 | static struct s3c24xx_i2s_info s3c24xx_i2s; |
80 | 85 | ||
@@ -184,7 +189,7 @@ static int s3c24xx_snd_lrsync(void) | |||
184 | if (iiscon & S3C2410_IISCON_LRINDEX) | 189 | if (iiscon & S3C2410_IISCON_LRINDEX) |
185 | break; | 190 | break; |
186 | 191 | ||
187 | if (timeout < jiffies) | 192 | if (time_after(jiffies, timeout)) |
188 | return -ETIMEDOUT; | 193 | return -ETIMEDOUT; |
189 | } | 194 | } |
190 | 195 | ||
@@ -405,6 +410,38 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev) | |||
405 | return 0; | 410 | return 0; |
406 | } | 411 | } |
407 | 412 | ||
413 | #ifdef CONFIG_PM | ||
414 | int 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 | |||
427 | int 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 | |||
408 | #define S3C24XX_I2S_RATES \ | 445 | #define S3C24XX_I2S_RATES \ |
409 | (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 | \ |
410 | 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 | \ |
@@ -415,6 +452,8 @@ struct snd_soc_cpu_dai s3c24xx_i2s_dai = { | |||
415 | .id = 0, | 452 | .id = 0, |
416 | .type = SND_SOC_DAI_I2S, | 453 | .type = SND_SOC_DAI_I2S, |
417 | .probe = s3c24xx_i2s_probe, | 454 | .probe = s3c24xx_i2s_probe, |
455 | .suspend = s3c24xx_i2s_suspend, | ||
456 | .resume = s3c24xx_i2s_resume, | ||
418 | .playback = { | 457 | .playback = { |
419 | .channels_min = 2, | 458 | .channels_min = 2, |
420 | .channels_max = 2, | 459 | .channels_max = 2, |