aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-11-22 15:37:19 +0900
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-23 14:08:15 +0000
commitb0f39c25a1bf6b4c81c183dfd0920e76f8e43488 (patch)
treef78e01b36865c7caef11e97c1bf9f95675854b4e
parentd98ce6cf0303dc8edc9fdc18f84e4d7dafbb61a2 (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>
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c2
-rw-r--r--sound/soc/s3c24xx/Kconfig2
-rw-r--r--sound/soc/s3c24xx/smdk_wm8580.c73
3 files changed, 55 insertions, 22 deletions
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 18b405d514d..dd192a27524 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -96,6 +96,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
/* I2C0 */
static struct i2c_board_info i2c_devs0[] __initdata = {
+ {I2C_BOARD_INFO("wm8580", 0x1b),},
};
/* I2C1 */
@@ -190,6 +191,7 @@ static struct platform_device *smdkc100_devices[] __initdata = {
&s3c_device_ts,
&s3c_device_wdt,
&smdkc100_lcd_powerdev,
+ &samsung_asoc_dma,
&s5pc100_device_iis0,
&samsung_device_keypad,
&s5pc100_device_ac97,
diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
index 396f678d1af..4989fad8356 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -62,7 +62,7 @@ config SND_S3C24XX_SOC_JIVE_WM8750
config SND_SOC_SMDK_WM8580
tristate "SoC I2S Audio support for WM8580 on SMDK"
- depends on SND_S3C24XX_SOC && MACH_SMDK6410
+ depends on SND_S3C24XX_SOC && (MACH_SMDK6410 || MACH_SMDKC100)
select SND_SOC_WM8580
select SND_SAMSUNG_I2S
help
diff --git a/sound/soc/s3c24xx/smdk_wm8580.c b/sound/soc/s3c24xx/smdk_wm8580.c
index b1b3d12abcb..0ae3d57d79e 100644
--- a/sound/soc/s3c24xx/smdk_wm8580.c
+++ b/sound/soc/s3c24xx/smdk_wm8580.c
@@ -17,6 +17,8 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
+#include <asm/mach-types.h>
+
#include "../codecs/wm8580.h"
#include "dma.h"
#include "i2s.h"
@@ -200,33 +202,49 @@ static int smdk_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd)
return 0;
}
+enum {
+ PRI_PLAYBACK = 0,
+ PRI_CAPTURE,
+ SEC_PLAYBACK,
+};
+
static struct snd_soc_dai_link smdk_dai[] = {
-{ /* Primary Playback i/f */
- .name = "WM8580 PAIF RX",
- .stream_name = "Playback",
- .cpu_dai_name = "samsung-i2s.2",
- .codec_dai_name = "wm8580-hifi-playback",
- .platform_name = "samsung-audio",
- .codec_name = "wm8580-codec.0-001b",
- .init = smdk_wm8580_init_paifrx,
- .ops = &smdk_ops,
-},
-{ /* Primary Capture i/f */
- .name = "WM8580 PAIF TX",
- .stream_name = "Capture",
- .cpu_dai_name = "samsung-i2s.2",
- .codec_dai_name = "wm8580-hifi-capture",
- .platform_name = "samsung-audio",
- .codec_name = "wm8580-codec.0-001b",
- .init = smdk_wm8580_init_paiftx,
- .ops = &smdk_ops,
-},
+ [PRI_PLAYBACK] = { /* Primary Playback i/f */
+ .name = "WM8580 PAIF RX",
+ .stream_name = "Playback",
+ .cpu_dai_name = "samsung-i2s.2",
+ .codec_dai_name = "wm8580-hifi-playback",
+ .platform_name = "samsung-audio",
+ .codec_name = "wm8580-codec.0-001b",
+ .init = smdk_wm8580_init_paifrx,
+ .ops = &smdk_ops,
+ },
+ [PRI_CAPTURE] = { /* Primary Capture i/f */
+ .name = "WM8580 PAIF TX",
+ .stream_name = "Capture",
+ .cpu_dai_name = "samsung-i2s.2",
+ .codec_dai_name = "wm8580-hifi-capture",
+ .platform_name = "samsung-audio",
+ .codec_name = "wm8580-codec.0-001b",
+ .init = smdk_wm8580_init_paiftx,
+ .ops = &smdk_ops,
+ },
+ [SEC_PLAYBACK] = { /* Sec_Fifo Playback i/f */
+ .name = "Sec_FIFO TX",
+ .stream_name = "Playback",
+ .cpu_dai_name = "samsung-i2s.x",
+ .codec_dai_name = "wm8580-hifi-playback",
+ .platform_name = "samsung-audio",
+ .codec_name = "wm8580-codec.0-001b",
+ .init = smdk_wm8580_init_paifrx,
+ .ops = &smdk_ops,
+ },
};
static struct snd_soc_card smdk = {
.name = "SMDK-I2S",
.dai_link = smdk_dai,
- .num_links = ARRAY_SIZE(smdk_dai),
+ .num_links = 2,
};
static struct platform_device *smdk_snd_device;
@@ -234,6 +252,19 @@ static struct platform_device *smdk_snd_device;
static int __init smdk_audio_init(void)
{
int ret;
+ char *str;
+
+ if (machine_is_smdkc100()) {
+ smdk.num_links = 3;
+ /* S5PC100 has I2S0 as v5 */
+ str = (char *)smdk_dai[PRI_PLAYBACK].cpu_dai_name;
+ str[strlen(str) - 1] = '0';
+ str = (char *)smdk_dai[PRI_CAPTURE].cpu_dai_name;
+ str[strlen(str) - 1] = '0';
+ /* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */
+ str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name;
+ str[strlen(str) - 1] = '0' + SAMSUNG_I2S_SECOFF;
+ }
smdk_snd_device = platform_device_alloc("soc-audio", -1);
if (!smdk_snd_device)