diff options
Diffstat (limited to 'sound/soc/s3c24xx/s3c64xx-i2s.c')
| -rw-r--r-- | sound/soc/s3c24xx/s3c64xx-i2s.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c index 105a77eeded0..cc7edb5f792d 100644 --- a/sound/soc/s3c24xx/s3c64xx-i2s.c +++ b/sound/soc/s3c24xx/s3c64xx-i2s.c | |||
| @@ -31,12 +31,11 @@ | |||
| 31 | #include <plat/gpio-bank-d.h> | 31 | #include <plat/gpio-bank-d.h> |
| 32 | #include <plat/gpio-bank-e.h> | 32 | #include <plat/gpio-bank-e.h> |
| 33 | #include <plat/gpio-cfg.h> | 33 | #include <plat/gpio-cfg.h> |
| 34 | #include <plat/audio.h> | ||
| 35 | 34 | ||
| 36 | #include <mach/map.h> | 35 | #include <mach/map.h> |
| 37 | #include <mach/dma.h> | 36 | #include <mach/dma.h> |
| 38 | 37 | ||
| 39 | #include "s3c24xx-pcm.h" | 38 | #include "s3c-dma.h" |
| 40 | #include "s3c64xx-i2s.h" | 39 | #include "s3c64xx-i2s.h" |
| 41 | 40 | ||
| 42 | static struct s3c2410_dma_client s3c64xx_dma_client_out = { | 41 | static struct s3c2410_dma_client s3c64xx_dma_client_out = { |
| @@ -47,7 +46,7 @@ static struct s3c2410_dma_client s3c64xx_dma_client_in = { | |||
| 47 | .name = "I2S PCM Stereo in" | 46 | .name = "I2S PCM Stereo in" |
| 48 | }; | 47 | }; |
| 49 | 48 | ||
| 50 | static struct s3c24xx_pcm_dma_params s3c64xx_i2s_pcm_stereo_out[2] = { | 49 | static struct s3c_dma_params s3c64xx_i2s_pcm_stereo_out[2] = { |
| 51 | [0] = { | 50 | [0] = { |
| 52 | .channel = DMACH_I2S0_OUT, | 51 | .channel = DMACH_I2S0_OUT, |
| 53 | .client = &s3c64xx_dma_client_out, | 52 | .client = &s3c64xx_dma_client_out, |
| @@ -62,7 +61,7 @@ static struct s3c24xx_pcm_dma_params s3c64xx_i2s_pcm_stereo_out[2] = { | |||
| 62 | }, | 61 | }, |
| 63 | }; | 62 | }; |
| 64 | 63 | ||
| 65 | static struct s3c24xx_pcm_dma_params s3c64xx_i2s_pcm_stereo_in[2] = { | 64 | static struct s3c_dma_params s3c64xx_i2s_pcm_stereo_in[2] = { |
| 66 | [0] = { | 65 | [0] = { |
| 67 | .channel = DMACH_I2S0_IN, | 66 | .channel = DMACH_I2S0_IN, |
| 68 | .client = &s3c64xx_dma_client_in, | 67 | .client = &s3c64xx_dma_client_in, |
| @@ -99,6 +98,19 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, | |||
| 99 | iismod |= S3C64XX_IISMOD_IMS_SYSMUX; | 98 | iismod |= S3C64XX_IISMOD_IMS_SYSMUX; |
| 100 | break; | 99 | break; |
| 101 | 100 | ||
| 101 | case S3C64XX_CLKSRC_CDCLK: | ||
| 102 | switch (dir) { | ||
| 103 | case SND_SOC_CLOCK_IN: | ||
| 104 | iismod |= S3C64XX_IISMOD_CDCLKCON; | ||
| 105 | break; | ||
| 106 | case SND_SOC_CLOCK_OUT: | ||
| 107 | iismod &= ~S3C64XX_IISMOD_CDCLKCON; | ||
| 108 | break; | ||
| 109 | default: | ||
| 110 | return -EINVAL; | ||
| 111 | } | ||
| 112 | break; | ||
| 113 | |||
| 102 | default: | 114 | default: |
| 103 | return -EINVAL; | 115 | return -EINVAL; |
| 104 | } | 116 | } |
| @@ -111,8 +123,12 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, | |||
| 111 | struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai) | 123 | struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai) |
| 112 | { | 124 | { |
| 113 | struct s3c_i2sv2_info *i2s = to_info(dai); | 125 | struct s3c_i2sv2_info *i2s = to_info(dai); |
| 126 | u32 iismod = readl(i2s->regs + S3C2412_IISMOD); | ||
| 114 | 127 | ||
| 115 | return i2s->iis_cclk; | 128 | if (iismod & S3C64XX_IISMOD_IMS_SYSMUX) |
| 129 | return i2s->iis_cclk; | ||
| 130 | else | ||
| 131 | return i2s->iis_pclk; | ||
| 116 | } | 132 | } |
| 117 | EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clock); | 133 | EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clock); |
| 118 | 134 | ||
