diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-05-20 06:00:43 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-20 06:00:43 -0400 |
commit | d71f4cece4bd97d05592836202fc04ff2e7817e3 (patch) | |
tree | 6c877c7a938758b1323d9c97d46b9c536e618c69 /sound/soc/s3c24xx/s3c64xx-i2s.c | |
parent | 19008bdacb9f7841166ebafe0aef361ee582ffbf (diff) | |
parent | ad8332c1302bcb4f80d593fd3eb477be9d7f5604 (diff) |
Merge branch 'topic/asoc' into for-linus
Conflicts:
sound/soc/codecs/ad1938.c
Diffstat (limited to 'sound/soc/s3c24xx/s3c64xx-i2s.c')
-rw-r--r-- | sound/soc/s3c24xx/s3c64xx-i2s.c | 69 |
1 files changed, 4 insertions, 65 deletions
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c index a72c251401ac..1d85cb85a7d2 100644 --- a/sound/soc/s3c24xx/s3c64xx-i2s.c +++ b/sound/soc/s3c24xx/s3c64xx-i2s.c | |||
@@ -12,16 +12,12 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/device.h> | ||
18 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
19 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
20 | #include <linux/io.h> | 17 | #include <linux/io.h> |
21 | 18 | ||
22 | #include <sound/soc.h> | 19 | #include <sound/soc.h> |
23 | 20 | ||
24 | #include <plat/regs-s3c2412-iis.h> | ||
25 | #include <mach/gpio-bank-d.h> | 21 | #include <mach/gpio-bank-d.h> |
26 | #include <mach/gpio-bank-e.h> | 22 | #include <mach/gpio-bank-e.h> |
27 | #include <plat/gpio-cfg.h> | 23 | #include <plat/gpio-cfg.h> |
@@ -30,6 +26,7 @@ | |||
30 | #include <mach/dma.h> | 26 | #include <mach/dma.h> |
31 | 27 | ||
32 | #include "s3c-dma.h" | 28 | #include "s3c-dma.h" |
29 | #include "regs-i2s-v2.h" | ||
33 | #include "s3c64xx-i2s.h" | 30 | #include "s3c64xx-i2s.h" |
34 | 31 | ||
35 | /* The value should be set to maximum of the total number | 32 | /* The value should be set to maximum of the total number |
@@ -57,55 +54,6 @@ static inline struct s3c_i2sv2_info *to_info(struct snd_soc_dai *cpu_dai) | |||
57 | return cpu_dai->private_data; | 54 | return cpu_dai->private_data; |
58 | } | 55 | } |
59 | 56 | ||
60 | static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, | ||
61 | int clk_id, unsigned int freq, int dir) | ||
62 | { | ||
63 | struct s3c_i2sv2_info *i2s = to_info(cpu_dai); | ||
64 | u32 iismod = readl(i2s->regs + S3C2412_IISMOD); | ||
65 | |||
66 | switch (clk_id) { | ||
67 | case S3C64XX_CLKSRC_PCLK: | ||
68 | iismod &= ~S3C64XX_IISMOD_IMS_SYSMUX; | ||
69 | break; | ||
70 | |||
71 | case S3C64XX_CLKSRC_MUX: | ||
72 | iismod |= S3C64XX_IISMOD_IMS_SYSMUX; | ||
73 | break; | ||
74 | |||
75 | case S3C64XX_CLKSRC_CDCLK: | ||
76 | switch (dir) { | ||
77 | case SND_SOC_CLOCK_IN: | ||
78 | iismod |= S3C64XX_IISMOD_CDCLKCON; | ||
79 | break; | ||
80 | case SND_SOC_CLOCK_OUT: | ||
81 | iismod &= ~S3C64XX_IISMOD_CDCLKCON; | ||
82 | break; | ||
83 | default: | ||
84 | return -EINVAL; | ||
85 | } | ||
86 | break; | ||
87 | |||
88 | default: | ||
89 | return -EINVAL; | ||
90 | } | ||
91 | |||
92 | writel(iismod, i2s->regs + S3C2412_IISMOD); | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai) | ||
98 | { | ||
99 | struct s3c_i2sv2_info *i2s = to_info(dai); | ||
100 | u32 iismod = readl(i2s->regs + S3C2412_IISMOD); | ||
101 | |||
102 | if (iismod & S3C64XX_IISMOD_IMS_SYSMUX) | ||
103 | return i2s->iis_cclk; | ||
104 | else | ||
105 | return i2s->iis_pclk; | ||
106 | } | ||
107 | EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clock); | ||
108 | |||
109 | static int s3c64xx_i2s_probe(struct platform_device *pdev, | 57 | static int s3c64xx_i2s_probe(struct platform_device *pdev, |
110 | struct snd_soc_dai *dai) | 58 | struct snd_soc_dai *dai) |
111 | { | 59 | { |
@@ -130,18 +78,7 @@ static int s3c64xx_i2s_probe(struct platform_device *pdev, | |||
130 | } | 78 | } |
131 | 79 | ||
132 | 80 | ||
133 | #define S3C64XX_I2S_RATES \ | 81 | static struct snd_soc_dai_ops s3c64xx_i2s_dai_ops; |
134 | (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \ | ||
135 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | ||
136 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | ||
137 | |||
138 | #define S3C64XX_I2S_FMTS \ | ||
139 | (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\ | ||
140 | SNDRV_PCM_FMTBIT_S24_LE) | ||
141 | |||
142 | static struct snd_soc_dai_ops s3c64xx_i2s_dai_ops = { | ||
143 | .set_sysclk = s3c64xx_i2s_set_sysclk, | ||
144 | }; | ||
145 | 82 | ||
146 | static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev) | 83 | static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev) |
147 | { | 84 | { |
@@ -171,6 +108,8 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev) | |||
171 | dai->probe = s3c64xx_i2s_probe; | 108 | dai->probe = s3c64xx_i2s_probe; |
172 | dai->ops = &s3c64xx_i2s_dai_ops; | 109 | dai->ops = &s3c64xx_i2s_dai_ops; |
173 | 110 | ||
111 | i2s->feature |= S3C_FEATURE_CDCLKCON; | ||
112 | |||
174 | i2s->dma_capture = &s3c64xx_i2s_pcm_stereo_in[pdev->id]; | 113 | i2s->dma_capture = &s3c64xx_i2s_pcm_stereo_in[pdev->id]; |
175 | i2s->dma_playback = &s3c64xx_i2s_pcm_stereo_out[pdev->id]; | 114 | i2s->dma_playback = &s3c64xx_i2s_pcm_stereo_out[pdev->id]; |
176 | 115 | ||