diff options
author | Jassi Brar <jassi.brar@samsung.com> | 2010-11-22 01:37:19 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-23 09:08:15 -0500 |
commit | b0f39c25a1bf6b4c81c183dfd0920e76f8e43488 (patch) | |
tree | f78e01b36865c7caef11e97c1bf9f95675854b4e /sound/soc/s3c24xx | |
parent | d98ce6cf0303dc8edc9fdc18f84e4d7dafbb61a2 (diff) |
ASoC: SMDK_WM8580: Enable for SMDKC100
Enable the ASoC Machine driver to run on SMDKC100 as well.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/s3c24xx')
-rw-r--r-- | sound/soc/s3c24xx/Kconfig | 2 | ||||
-rw-r--r-- | sound/soc/s3c24xx/smdk_wm8580.c | 73 |
2 files changed, 53 insertions, 22 deletions
diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig index 396f678d1af5..4989fad83563 100644 --- a/sound/soc/s3c24xx/Kconfig +++ b/sound/soc/s3c24xx/Kconfig | |||
@@ -62,7 +62,7 @@ config SND_S3C24XX_SOC_JIVE_WM8750 | |||
62 | 62 | ||
63 | config SND_SOC_SMDK_WM8580 | 63 | config SND_SOC_SMDK_WM8580 |
64 | tristate "SoC I2S Audio support for WM8580 on SMDK" | 64 | tristate "SoC I2S Audio support for WM8580 on SMDK" |
65 | depends on SND_S3C24XX_SOC && MACH_SMDK6410 | 65 | depends on SND_S3C24XX_SOC && (MACH_SMDK6410 || MACH_SMDKC100) |
66 | select SND_SOC_WM8580 | 66 | select SND_SOC_WM8580 |
67 | select SND_SAMSUNG_I2S | 67 | select SND_SAMSUNG_I2S |
68 | help | 68 | help |
diff --git a/sound/soc/s3c24xx/smdk_wm8580.c b/sound/soc/s3c24xx/smdk_wm8580.c index b1b3d12abcb9..0ae3d57d79e6 100644 --- a/sound/soc/s3c24xx/smdk_wm8580.c +++ b/sound/soc/s3c24xx/smdk_wm8580.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <sound/pcm_params.h> | 17 | #include <sound/pcm_params.h> |
18 | #include <sound/soc.h> | 18 | #include <sound/soc.h> |
19 | 19 | ||
20 | #include <asm/mach-types.h> | ||
21 | |||
20 | #include "../codecs/wm8580.h" | 22 | #include "../codecs/wm8580.h" |
21 | #include "dma.h" | 23 | #include "dma.h" |
22 | #include "i2s.h" | 24 | #include "i2s.h" |
@@ -200,33 +202,49 @@ static int smdk_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd) | |||
200 | return 0; | 202 | return 0; |
201 | } | 203 | } |
202 | 204 | ||
205 | enum { | ||
206 | PRI_PLAYBACK = 0, | ||
207 | PRI_CAPTURE, | ||
208 | SEC_PLAYBACK, | ||
209 | }; | ||
210 | |||
203 | static struct snd_soc_dai_link smdk_dai[] = { | 211 | static struct snd_soc_dai_link smdk_dai[] = { |
204 | { /* Primary Playback i/f */ | 212 | [PRI_PLAYBACK] = { /* Primary Playback i/f */ |
205 | .name = "WM8580 PAIF RX", | 213 | .name = "WM8580 PAIF RX", |
206 | .stream_name = "Playback", | 214 | .stream_name = "Playback", |
207 | .cpu_dai_name = "samsung-i2s.2", | 215 | .cpu_dai_name = "samsung-i2s.2", |
208 | .codec_dai_name = "wm8580-hifi-playback", | 216 | .codec_dai_name = "wm8580-hifi-playback", |
209 | .platform_name = "samsung-audio", | 217 | .platform_name = "samsung-audio", |
210 | .codec_name = "wm8580-codec.0-001b", | 218 | .codec_name = "wm8580-codec.0-001b", |
211 | .init = smdk_wm8580_init_paifrx, | 219 | .init = smdk_wm8580_init_paifrx, |
212 | .ops = &smdk_ops, | 220 | .ops = &smdk_ops, |
213 | }, | 221 | }, |
214 | { /* Primary Capture i/f */ | 222 | [PRI_CAPTURE] = { /* Primary Capture i/f */ |
215 | .name = "WM8580 PAIF TX", | 223 | .name = "WM8580 PAIF TX", |
216 | .stream_name = "Capture", | 224 | .stream_name = "Capture", |
217 | .cpu_dai_name = "samsung-i2s.2", | 225 | .cpu_dai_name = "samsung-i2s.2", |
218 | .codec_dai_name = "wm8580-hifi-capture", | 226 | .codec_dai_name = "wm8580-hifi-capture", |
219 | .platform_name = "samsung-audio", | 227 | .platform_name = "samsung-audio", |
220 | .codec_name = "wm8580-codec.0-001b", | 228 | .codec_name = "wm8580-codec.0-001b", |
221 | .init = smdk_wm8580_init_paiftx, | 229 | .init = smdk_wm8580_init_paiftx, |
222 | .ops = &smdk_ops, | 230 | .ops = &smdk_ops, |
223 | }, | 231 | }, |
232 | [SEC_PLAYBACK] = { /* Sec_Fifo Playback i/f */ | ||
233 | .name = "Sec_FIFO TX", | ||
234 | .stream_name = "Playback", | ||
235 | .cpu_dai_name = "samsung-i2s.x", | ||
236 | .codec_dai_name = "wm8580-hifi-playback", | ||
237 | .platform_name = "samsung-audio", | ||
238 | .codec_name = "wm8580-codec.0-001b", | ||
239 | .init = smdk_wm8580_init_paifrx, | ||
240 | .ops = &smdk_ops, | ||
241 | }, | ||
224 | }; | 242 | }; |
225 | 243 | ||
226 | static struct snd_soc_card smdk = { | 244 | static struct snd_soc_card smdk = { |
227 | .name = "SMDK-I2S", | 245 | .name = "SMDK-I2S", |
228 | .dai_link = smdk_dai, | 246 | .dai_link = smdk_dai, |
229 | .num_links = ARRAY_SIZE(smdk_dai), | 247 | .num_links = 2, |
230 | }; | 248 | }; |
231 | 249 | ||
232 | static struct platform_device *smdk_snd_device; | 250 | static struct platform_device *smdk_snd_device; |
@@ -234,6 +252,19 @@ static struct platform_device *smdk_snd_device; | |||
234 | static int __init smdk_audio_init(void) | 252 | static int __init smdk_audio_init(void) |
235 | { | 253 | { |
236 | int ret; | 254 | int ret; |
255 | char *str; | ||
256 | |||
257 | if (machine_is_smdkc100()) { | ||
258 | smdk.num_links = 3; | ||
259 | /* S5PC100 has I2S0 as v5 */ | ||
260 | str = (char *)smdk_dai[PRI_PLAYBACK].cpu_dai_name; | ||
261 | str[strlen(str) - 1] = '0'; | ||
262 | str = (char *)smdk_dai[PRI_CAPTURE].cpu_dai_name; | ||
263 | str[strlen(str) - 1] = '0'; | ||
264 | /* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */ | ||
265 | str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name; | ||
266 | str[strlen(str) - 1] = '0' + SAMSUNG_I2S_SECOFF; | ||
267 | } | ||
237 | 268 | ||
238 | smdk_snd_device = platform_device_alloc("soc-audio", -1); | 269 | smdk_snd_device = platform_device_alloc("soc-audio", -1); |
239 | if (!smdk_snd_device) | 270 | if (!smdk_snd_device) |