aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-05-19 05:05:33 -0400
committerBen Dooks <ben-linux@fluff.org>2010-05-19 05:05:33 -0400
commit1770a8988f6178efdc1bfc85fb29deacac49fe91 (patch)
treeb20b8da8b92e388847a55e7c7da9d919fe3f3abb
parent1e8ff636beb6ee5c87868a6081cc4f95b1ccd713 (diff)
parent734552072335b00476b626b027ca4a9f57147b6f (diff)
ARM: Merge for-2635/s5p-audio
Merge branch 'for-2635/s5p-audio' into for-linus/samsung2
-rw-r--r--arch/arm/mach-s5p6440/Makefile3
-rw-r--r--arch/arm/mach-s5p6440/dev-audio.c127
-rw-r--r--arch/arm/mach-s5p6440/include/mach/map.h6
-rw-r--r--arch/arm/mach-s5p6440/mach-smdk6440.c1
-rw-r--r--arch/arm/mach-s5p6442/Makefile3
-rw-r--r--arch/arm/mach-s5p6442/dev-audio.c197
-rw-r--r--arch/arm/mach-s5p6442/include/mach/map.h8
-rw-r--r--arch/arm/mach-s5p6442/mach-smdk6442.c1
-rw-r--r--arch/arm/mach-s5pv210/Makefile4
-rw-r--r--arch/arm/mach-s5pv210/dev-audio.c327
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h13
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c2
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h16
14 files changed, 710 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile
index 3f243dd1ad14..5fd17d3da0cb 100644
--- a/arch/arm/mach-s5p6440/Makefile
+++ b/arch/arm/mach-s5p6440/Makefile
@@ -17,3 +17,6 @@ obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o dma.o
17# machine support 17# machine support
18 18
19obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o 19obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o
20
21# device support
22obj-y += dev-audio.o
diff --git a/arch/arm/mach-s5p6440/dev-audio.c b/arch/arm/mach-s5p6440/dev-audio.c
new file mode 100644
index 000000000000..0c5367962830
--- /dev/null
+++ b/arch/arm/mach-s5p6440/dev-audio.c
@@ -0,0 +1,127 @@
1/* linux/arch/arm/mach-s5p6440/dev-audio.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h>
13
14#include <plat/gpio-cfg.h>
15#include <plat/audio.h>
16
17#include <mach/gpio.h>
18#include <mach/map.h>
19#include <mach/dma.h>
20#include <mach/irqs.h>
21
22static int s5p6440_cfg_i2s(struct platform_device *pdev)
23{
24 /* configure GPIO for i2s port */
25 switch (pdev->id) {
26 case -1:
27 s3c_gpio_cfgpin(S5P6440_GPR(4), S3C_GPIO_SFN(5));
28 s3c_gpio_cfgpin(S5P6440_GPR(5), S3C_GPIO_SFN(5));
29 s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(5));
30 s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(5));
31 s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(5));
32 s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(5));
33 s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(5));
34 break;
35
36 default:
37 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
38 return -EINVAL;
39 }
40
41 return 0;
42}
43
44static struct s3c_audio_pdata s3c_i2s_pdata = {
45 .cfg_gpio = s5p6440_cfg_i2s,
46};
47
48static struct resource s5p6440_iis0_resource[] = {
49 [0] = {
50 .start = S5P6440_PA_I2S,
51 .end = S5P6440_PA_I2S + 0x100 - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = DMACH_I2S0_TX,
56 .end = DMACH_I2S0_TX,
57 .flags = IORESOURCE_DMA,
58 },
59 [2] = {
60 .start = DMACH_I2S0_RX,
61 .end = DMACH_I2S0_RX,
62 .flags = IORESOURCE_DMA,
63 },
64};
65
66struct platform_device s5p6440_device_iis = {
67 .name = "s3c64xx-iis-v4",
68 .id = -1,
69 .num_resources = ARRAY_SIZE(s5p6440_iis0_resource),
70 .resource = s5p6440_iis0_resource,
71 .dev = {
72 .platform_data = &s3c_i2s_pdata,
73 },
74};
75
76/* PCM Controller platform_devices */
77
78static int s5p6440_pcm_cfg_gpio(struct platform_device *pdev)
79{
80 switch (pdev->id) {
81 case 0:
82 s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(2));
83 s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(2));
84 s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(2));
85 s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(2));
86 s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(2));
87 break;
88
89 default:
90 printk(KERN_DEBUG "Invalid PCM Controller number!");
91 return -EINVAL;
92 }
93
94 return 0;
95}
96
97static struct s3c_audio_pdata s3c_pcm_pdata = {
98 .cfg_gpio = s5p6440_pcm_cfg_gpio,
99};
100
101static struct resource s5p6440_pcm0_resource[] = {
102 [0] = {
103 .start = S5P6440_PA_PCM,
104 .end = S5P6440_PA_PCM + 0x100 - 1,
105 .flags = IORESOURCE_MEM,
106 },
107 [1] = {
108 .start = DMACH_PCM0_TX,
109 .end = DMACH_PCM0_TX,
110 .flags = IORESOURCE_DMA,
111 },
112 [2] = {
113 .start = DMACH_PCM0_RX,
114 .end = DMACH_PCM0_RX,
115 .flags = IORESOURCE_DMA,
116 },
117};
118
119struct platform_device s5p6440_device_pcm = {
120 .name = "samsung-pcm",
121 .id = 0,
122 .num_resources = ARRAY_SIZE(s5p6440_pcm0_resource),
123 .resource = s5p6440_pcm0_resource,
124 .dev = {
125 .platform_data = &s3c_pcm_pdata,
126 },
127};
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h
index 0275784eb22f..72aedadd412c 100644
--- a/arch/arm/mach-s5p6440/include/mach/map.h
+++ b/arch/arm/mach-s5p6440/include/mach/map.h
@@ -63,6 +63,12 @@
63#define S5P6440_PA_SDRAM (0x20000000) 63#define S5P6440_PA_SDRAM (0x20000000)
64#define S5P_PA_SDRAM S5P6440_PA_SDRAM 64#define S5P_PA_SDRAM S5P6440_PA_SDRAM
65 65
66/* I2S */
67#define S5P6440_PA_I2S 0xF2000000
68
69/* PCM */
70#define S5P6440_PA_PCM 0xF2100000
71
66/* compatibiltiy defines. */ 72/* compatibiltiy defines. */
67#define S3C_PA_UART S5P6440_PA_UART 73#define S3C_PA_UART S5P6440_PA_UART
68#define S3C_PA_IIC S5P6440_PA_IIC0 74#define S3C_PA_IIC S5P6440_PA_IIC0
diff --git a/arch/arm/mach-s5p6440/mach-smdk6440.c b/arch/arm/mach-s5p6440/mach-smdk6440.c
index 3ae88f2c7c77..d7fede971ca6 100644
--- a/arch/arm/mach-s5p6440/mach-smdk6440.c
+++ b/arch/arm/mach-s5p6440/mach-smdk6440.c
@@ -84,6 +84,7 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
84}; 84};
85 85
86static struct platform_device *smdk6440_devices[] __initdata = { 86static struct platform_device *smdk6440_devices[] __initdata = {
87 &s5p6440_device_iis,
87}; 88};
88 89
89static void __init smdk6440_map_io(void) 90static void __init smdk6440_map_io(void)
diff --git a/arch/arm/mach-s5p6442/Makefile b/arch/arm/mach-s5p6442/Makefile
index 17bd22ee107d..bf30550349cf 100644
--- a/arch/arm/mach-s5p6442/Makefile
+++ b/arch/arm/mach-s5p6442/Makefile
@@ -17,3 +17,6 @@ obj-$(CONFIG_CPU_S5P6442) += cpu.o init.o clock.o dma.o
17# machine support 17# machine support
18 18
19obj-$(CONFIG_MACH_SMDK6442) += mach-smdk6442.o 19obj-$(CONFIG_MACH_SMDK6442) += mach-smdk6442.o
20
21# device support
22obj-y += dev-audio.o
diff --git a/arch/arm/mach-s5p6442/dev-audio.c b/arch/arm/mach-s5p6442/dev-audio.c
new file mode 100644
index 000000000000..cb801e1f5e23
--- /dev/null
+++ b/arch/arm/mach-s5p6442/dev-audio.c
@@ -0,0 +1,197 @@
1/* linux/arch/arm/mach-s5p6442/dev-audio.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h>
13
14#include <plat/gpio-cfg.h>
15#include <plat/audio.h>
16
17#include <mach/gpio.h>
18#include <mach/map.h>
19#include <mach/dma.h>
20#include <mach/irqs.h>
21
22static int s5p6442_cfg_i2s(struct platform_device *pdev)
23{
24 /* configure GPIO for i2s port */
25 switch (pdev->id) {
26 case 1:
27 s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(2));
28 s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(2));
29 s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(2));
30 s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(2));
31 s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(2));
32 break;
33
34 case -1:
35 s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(2));
36 s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(2));
37 s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(2));
38 s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(2));
39 s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(2));
40 break;
41
42 default:
43 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
44 return -EINVAL;
45 }
46
47 return 0;
48}
49
50static struct s3c_audio_pdata s3c_i2s_pdata = {
51 .cfg_gpio = s5p6442_cfg_i2s,
52};
53
54static struct resource s5p6442_iis0_resource[] = {
55 [0] = {
56 .start = S5P6442_PA_I2S0,
57 .end = S5P6442_PA_I2S0 + 0x100 - 1,
58 .flags = IORESOURCE_MEM,
59 },
60 [1] = {
61 .start = DMACH_I2S0_TX,
62 .end = DMACH_I2S0_TX,
63 .flags = IORESOURCE_DMA,
64 },
65 [2] = {
66 .start = DMACH_I2S0_RX,
67 .end = DMACH_I2S0_RX,
68 .flags = IORESOURCE_DMA,
69 },
70};
71
72struct platform_device s5p6442_device_iis0 = {
73 .name = "s3c64xx-iis-v4",
74 .id = -1,
75 .num_resources = ARRAY_SIZE(s5p6442_iis0_resource),
76 .resource = s5p6442_iis0_resource,
77 .dev = {
78 .platform_data = &s3c_i2s_pdata,
79 },
80};
81
82static struct resource s5p6442_iis1_resource[] = {
83 [0] = {
84 .start = S5P6442_PA_I2S1,
85 .end = S5P6442_PA_I2S1 + 0x100 - 1,
86 .flags = IORESOURCE_MEM,
87 },
88 [1] = {
89 .start = DMACH_I2S1_TX,
90 .end = DMACH_I2S1_TX,
91 .flags = IORESOURCE_DMA,
92 },
93 [2] = {
94 .start = DMACH_I2S1_RX,
95 .end = DMACH_I2S1_RX,
96 .flags = IORESOURCE_DMA,
97 },
98};
99
100struct platform_device s5p6442_device_iis1 = {
101 .name = "s3c64xx-iis",
102 .id = 1,
103 .num_resources = ARRAY_SIZE(s5p6442_iis1_resource),
104 .resource = s5p6442_iis1_resource,
105 .dev = {
106 .platform_data = &s3c_i2s_pdata,
107 },
108};
109
110/* PCM Controller platform_devices */
111
112static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
113{
114 switch (pdev->id) {
115 case 0:
116 s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(3));
117 s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(3));
118 s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(3));
119 s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(3));
120 s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(3));
121 break;
122
123 case 1:
124 s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(3));
125 s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(3));
126 s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(3));
127 s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(3));
128 s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(3));
129 break;
130
131 default:
132 printk(KERN_DEBUG "Invalid PCM Controller number!");
133 return -EINVAL;
134 }
135
136 return 0;
137}
138
139static struct s3c_audio_pdata s3c_pcm_pdata = {
140 .cfg_gpio = s5p6442_pcm_cfg_gpio,
141};
142
143static struct resource s5p6442_pcm0_resource[] = {
144 [0] = {
145 .start = S5P6442_PA_PCM0,
146 .end = S5P6442_PA_PCM0 + 0x100 - 1,
147 .flags = IORESOURCE_MEM,
148 },
149 [1] = {
150 .start = DMACH_PCM0_TX,
151 .end = DMACH_PCM0_TX,
152 .flags = IORESOURCE_DMA,
153 },
154 [2] = {
155 .start = DMACH_PCM0_RX,
156 .end = DMACH_PCM0_RX,
157 .flags = IORESOURCE_DMA,
158 },
159};
160
161struct platform_device s5p6442_device_pcm0 = {
162 .name = "samsung-pcm",
163 .id = 0,
164 .num_resources = ARRAY_SIZE(s5p6442_pcm0_resource),
165 .resource = s5p6442_pcm0_resource,
166 .dev = {
167 .platform_data = &s3c_pcm_pdata,
168 },
169};
170
171static struct resource s5p6442_pcm1_resource[] = {
172 [0] = {
173 .start = S5P6442_PA_PCM1,
174 .end = S5P6442_PA_PCM1 + 0x100 - 1,
175 .flags = IORESOURCE_MEM,
176 },
177 [1] = {
178 .start = DMACH_PCM1_TX,
179 .end = DMACH_PCM1_TX,
180 .flags = IORESOURCE_DMA,
181 },
182 [2] = {
183 .start = DMACH_PCM1_RX,
184 .end = DMACH_PCM1_RX,
185 .flags = IORESOURCE_DMA,
186 },
187};
188
189struct platform_device s5p6442_device_pcm1 = {
190 .name = "samsung-pcm",
191 .id = 1,
192 .num_resources = ARRAY_SIZE(s5p6442_pcm1_resource),
193 .resource = s5p6442_pcm1_resource,
194 .dev = {
195 .platform_data = &s3c_pcm_pdata,
196 },
197};
diff --git a/arch/arm/mach-s5p6442/include/mach/map.h b/arch/arm/mach-s5p6442/include/mach/map.h
index a263d77f6968..7568dc0d6be0 100644
--- a/arch/arm/mach-s5p6442/include/mach/map.h
+++ b/arch/arm/mach-s5p6442/include/mach/map.h
@@ -54,6 +54,14 @@
54#define S5P6442_PA_SDRAM (0x20000000) 54#define S5P6442_PA_SDRAM (0x20000000)
55#define S5P_PA_SDRAM S5P6442_PA_SDRAM 55#define S5P_PA_SDRAM S5P6442_PA_SDRAM
56 56
57/* I2S */
58#define S5P6442_PA_I2S0 0xC0B00000
59#define S5P6442_PA_I2S1 0xF2200000
60
61/* PCM */
62#define S5P6442_PA_PCM0 0xF2400000
63#define S5P6442_PA_PCM1 0xF2500000
64
57/* compatibiltiy defines. */ 65/* compatibiltiy defines. */
58#define S3C_PA_UART S5P6442_PA_UART 66#define S3C_PA_UART S5P6442_PA_UART
59#define S3C_PA_IIC S5P6442_PA_IIC0 67#define S3C_PA_IIC S5P6442_PA_IIC0
diff --git a/arch/arm/mach-s5p6442/mach-smdk6442.c b/arch/arm/mach-s5p6442/mach-smdk6442.c
index 0d63371ce07c..ebcf99777259 100644
--- a/arch/arm/mach-s5p6442/mach-smdk6442.c
+++ b/arch/arm/mach-s5p6442/mach-smdk6442.c
@@ -65,6 +65,7 @@ static struct s3c2410_uartcfg smdk6442_uartcfgs[] __initdata = {
65}; 65};
66 66
67static struct platform_device *smdk6442_devices[] __initdata = { 67static struct platform_device *smdk6442_devices[] __initdata = {
68 &s5p6442_device_iis0,
68}; 69};
69 70
70static void __init smdk6442_map_io(void) 71static void __init smdk6442_map_io(void)
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 192deac8aaab..1d60b358589b 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -18,3 +18,7 @@ obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o dma.o gpiolib.o
18 18
19obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o 19obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
20obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o 20obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
21
22# device support
23
24obj-y += dev-audio.o
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
new file mode 100644
index 000000000000..6e215330a1be
--- /dev/null
+++ b/arch/arm/mach-s5pv210/dev-audio.c
@@ -0,0 +1,327 @@
1/* linux/arch/arm/mach-s5pv210/dev-audio.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h>
13
14#include <plat/gpio-cfg.h>
15#include <plat/audio.h>
16
17#include <mach/gpio.h>
18#include <mach/map.h>
19#include <mach/dma.h>
20#include <mach/irqs.h>
21
22static int s5pv210_cfg_i2s(struct platform_device *pdev)
23{
24 /* configure GPIO for i2s port */
25 switch (pdev->id) {
26 case 1:
27 s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(2));
28 s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(2));
29 s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(2));
30 s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(2));
31 s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(2));
32 break;
33
34 case 2:
35 s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(4));
36 s3c_gpio_cfgpin(S5PV210_GPC1(1), S3C_GPIO_SFN(4));
37 s3c_gpio_cfgpin(S5PV210_GPC1(2), S3C_GPIO_SFN(4));
38 s3c_gpio_cfgpin(S5PV210_GPC1(3), S3C_GPIO_SFN(4));
39 s3c_gpio_cfgpin(S5PV210_GPC1(4), S3C_GPIO_SFN(4));
40 break;
41
42 case -1:
43 s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(2));
44 s3c_gpio_cfgpin(S5PV210_GPI(1), S3C_GPIO_SFN(2));
45 s3c_gpio_cfgpin(S5PV210_GPI(2), S3C_GPIO_SFN(2));
46 s3c_gpio_cfgpin(S5PV210_GPI(3), S3C_GPIO_SFN(2));
47 s3c_gpio_cfgpin(S5PV210_GPI(4), S3C_GPIO_SFN(2));
48 s3c_gpio_cfgpin(S5PV210_GPI(5), S3C_GPIO_SFN(2));
49 s3c_gpio_cfgpin(S5PV210_GPI(6), S3C_GPIO_SFN(2));
50 break;
51
52 default:
53 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
54 return -EINVAL;
55 }
56
57 return 0;
58}
59
60static struct s3c_audio_pdata s3c_i2s_pdata = {
61 .cfg_gpio = s5pv210_cfg_i2s,
62};
63
64static struct resource s5pv210_iis0_resource[] = {
65 [0] = {
66 .start = S5PV210_PA_IIS0,
67 .end = S5PV210_PA_IIS0 + 0x100 - 1,
68 .flags = IORESOURCE_MEM,
69 },
70 [1] = {
71 .start = DMACH_I2S0_TX,
72 .end = DMACH_I2S0_TX,
73 .flags = IORESOURCE_DMA,
74 },
75 [2] = {
76 .start = DMACH_I2S0_RX,
77 .end = DMACH_I2S0_RX,
78 .flags = IORESOURCE_DMA,
79 },
80};
81
82struct platform_device s5pv210_device_iis0 = {
83 .name = "s3c64xx-iis-v4",
84 .id = -1,
85 .num_resources = ARRAY_SIZE(s5pv210_iis0_resource),
86 .resource = s5pv210_iis0_resource,
87 .dev = {
88 .platform_data = &s3c_i2s_pdata,
89 },
90};
91
92static struct resource s5pv210_iis1_resource[] = {
93 [0] = {
94 .start = S5PV210_PA_IIS1,
95 .end = S5PV210_PA_IIS1 + 0x100 - 1,
96 .flags = IORESOURCE_MEM,
97 },
98 [1] = {
99 .start = DMACH_I2S1_TX,
100 .end = DMACH_I2S1_TX,
101 .flags = IORESOURCE_DMA,
102 },
103 [2] = {
104 .start = DMACH_I2S1_RX,
105 .end = DMACH_I2S1_RX,
106 .flags = IORESOURCE_DMA,
107 },
108};
109
110struct platform_device s5pv210_device_iis1 = {
111 .name = "s3c64xx-iis",
112 .id = 1,
113 .num_resources = ARRAY_SIZE(s5pv210_iis1_resource),
114 .resource = s5pv210_iis1_resource,
115 .dev = {
116 .platform_data = &s3c_i2s_pdata,
117 },
118};
119
120static struct resource s5pv210_iis2_resource[] = {
121 [0] = {
122 .start = S5PV210_PA_IIS2,
123 .end = S5PV210_PA_IIS2 + 0x100 - 1,
124 .flags = IORESOURCE_MEM,
125 },
126 [1] = {
127 .start = DMACH_I2S2_TX,
128 .end = DMACH_I2S2_TX,
129 .flags = IORESOURCE_DMA,
130 },
131 [2] = {
132 .start = DMACH_I2S2_RX,
133 .end = DMACH_I2S2_RX,
134 .flags = IORESOURCE_DMA,
135 },
136};
137
138struct platform_device s5pv210_device_iis2 = {
139 .name = "s3c64xx-iis",
140 .id = 2,
141 .num_resources = ARRAY_SIZE(s5pv210_iis2_resource),
142 .resource = s5pv210_iis2_resource,
143 .dev = {
144 .platform_data = &s3c_i2s_pdata,
145 },
146};
147
148/* PCM Controller platform_devices */
149
150static int s5pv210_pcm_cfg_gpio(struct platform_device *pdev)
151{
152 switch (pdev->id) {
153 case 0:
154 s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(3));
155 s3c_gpio_cfgpin(S5PV210_GPI(1), S3C_GPIO_SFN(3));
156 s3c_gpio_cfgpin(S5PV210_GPI(2), S3C_GPIO_SFN(3));
157 s3c_gpio_cfgpin(S5PV210_GPI(3), S3C_GPIO_SFN(3));
158 s3c_gpio_cfgpin(S5PV210_GPI(4), S3C_GPIO_SFN(3));
159 break;
160 case 1:
161 s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(3));
162 s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(3));
163 s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(3));
164 s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(3));
165 s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(3));
166 break;
167 case 2:
168 s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(2));
169 s3c_gpio_cfgpin(S5PV210_GPC1(1), S3C_GPIO_SFN(2));
170 s3c_gpio_cfgpin(S5PV210_GPC1(2), S3C_GPIO_SFN(2));
171 s3c_gpio_cfgpin(S5PV210_GPC1(3), S3C_GPIO_SFN(2));
172 s3c_gpio_cfgpin(S5PV210_GPC1(4), S3C_GPIO_SFN(2));
173 break;
174 default:
175 printk(KERN_DEBUG "Invalid PCM Controller number!");
176 return -EINVAL;
177 }
178
179 return 0;
180}
181
182static struct s3c_audio_pdata s3c_pcm_pdata = {
183 .cfg_gpio = s5pv210_pcm_cfg_gpio,
184};
185
186static struct resource s5pv210_pcm0_resource[] = {
187 [0] = {
188 .start = S5PV210_PA_PCM0,
189 .end = S5PV210_PA_PCM0 + 0x100 - 1,
190 .flags = IORESOURCE_MEM,
191 },
192 [1] = {
193 .start = DMACH_PCM0_TX,
194 .end = DMACH_PCM0_TX,
195 .flags = IORESOURCE_DMA,
196 },
197 [2] = {
198 .start = DMACH_PCM0_RX,
199 .end = DMACH_PCM0_RX,
200 .flags = IORESOURCE_DMA,
201 },
202};
203
204struct platform_device s5pv210_device_pcm0 = {
205 .name = "samsung-pcm",
206 .id = 0,
207 .num_resources = ARRAY_SIZE(s5pv210_pcm0_resource),
208 .resource = s5pv210_pcm0_resource,
209 .dev = {
210 .platform_data = &s3c_pcm_pdata,
211 },
212};
213
214static struct resource s5pv210_pcm1_resource[] = {
215 [0] = {
216 .start = S5PV210_PA_PCM1,
217 .end = S5PV210_PA_PCM1 + 0x100 - 1,
218 .flags = IORESOURCE_MEM,
219 },
220 [1] = {
221 .start = DMACH_PCM1_TX,
222 .end = DMACH_PCM1_TX,
223 .flags = IORESOURCE_DMA,
224 },
225 [2] = {
226 .start = DMACH_PCM1_RX,
227 .end = DMACH_PCM1_RX,
228 .flags = IORESOURCE_DMA,
229 },
230};
231
232struct platform_device s5pv210_device_pcm1 = {
233 .name = "samsung-pcm",
234 .id = 1,
235 .num_resources = ARRAY_SIZE(s5pv210_pcm1_resource),
236 .resource = s5pv210_pcm1_resource,
237 .dev = {
238 .platform_data = &s3c_pcm_pdata,
239 },
240};
241
242static struct resource s5pv210_pcm2_resource[] = {
243 [0] = {
244 .start = S5PV210_PA_PCM2,
245 .end = S5PV210_PA_PCM2 + 0x100 - 1,
246 .flags = IORESOURCE_MEM,
247 },
248 [1] = {
249 .start = DMACH_PCM2_TX,
250 .end = DMACH_PCM2_TX,
251 .flags = IORESOURCE_DMA,
252 },
253 [2] = {
254 .start = DMACH_PCM2_RX,
255 .end = DMACH_PCM2_RX,
256 .flags = IORESOURCE_DMA,
257 },
258};
259
260struct platform_device s5pv210_device_pcm2 = {
261 .name = "samsung-pcm",
262 .id = 2,
263 .num_resources = ARRAY_SIZE(s5pv210_pcm2_resource),
264 .resource = s5pv210_pcm2_resource,
265 .dev = {
266 .platform_data = &s3c_pcm_pdata,
267 },
268};
269
270/* AC97 Controller platform devices */
271
272static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev)
273{
274 s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(4));
275 s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(4));
276 s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(4));
277 s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(4));
278 s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(4));
279
280 return 0;
281}
282
283static struct resource s5pv210_ac97_resource[] = {
284 [0] = {
285 .start = S5PV210_PA_AC97,
286 .end = S5PV210_PA_AC97 + 0x100 - 1,
287 .flags = IORESOURCE_MEM,
288 },
289 [1] = {
290 .start = DMACH_AC97_PCMOUT,
291 .end = DMACH_AC97_PCMOUT,
292 .flags = IORESOURCE_DMA,
293 },
294 [2] = {
295 .start = DMACH_AC97_PCMIN,
296 .end = DMACH_AC97_PCMIN,
297 .flags = IORESOURCE_DMA,
298 },
299 [3] = {
300 .start = DMACH_AC97_MICIN,
301 .end = DMACH_AC97_MICIN,
302 .flags = IORESOURCE_DMA,
303 },
304 [4] = {
305 .start = IRQ_AC97,
306 .end = IRQ_AC97,
307 .flags = IORESOURCE_IRQ,
308 },
309};
310
311static struct s3c_audio_pdata s3c_ac97_pdata = {
312 .cfg_gpio = s5pv210_ac97_cfg_gpio,
313};
314
315static u64 s5pv210_ac97_dmamask = DMA_BIT_MASK(32);
316
317struct platform_device s5pv210_device_ac97 = {
318 .name = "s3c-ac97",
319 .id = -1,
320 .num_resources = ARRAY_SIZE(s5pv210_ac97_resource),
321 .resource = s5pv210_ac97_resource,
322 .dev = {
323 .platform_data = &s3c_ac97_pdata,
324 .dma_mask = &s5pv210_ac97_dmamask,
325 .coherent_dma_mask = DMA_BIT_MASK(32),
326 },
327};
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index c038585080c0..5adcb9f26e44 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -62,6 +62,19 @@
62#define S5PV210_PA_SDRAM (0x20000000) 62#define S5PV210_PA_SDRAM (0x20000000)
63#define S5P_PA_SDRAM S5PV210_PA_SDRAM 63#define S5P_PA_SDRAM S5PV210_PA_SDRAM
64 64
65/* I2S */
66#define S5PV210_PA_IIS0 0xEEE30000
67#define S5PV210_PA_IIS1 0xE2100000
68#define S5PV210_PA_IIS2 0xE2A00000
69
70/* PCM */
71#define S5PV210_PA_PCM0 0xE2300000
72#define S5PV210_PA_PCM1 0xE1200000
73#define S5PV210_PA_PCM2 0xE2B00000
74
75/* AC97 */
76#define S5PV210_PA_AC97 0xE2200000
77
65/* compatibiltiy defines. */ 78/* compatibiltiy defines. */
66#define S3C_PA_UART S5PV210_PA_UART 79#define S3C_PA_UART S5PV210_PA_UART
67#define S3C_PA_IIC S5PV210_PA_IIC0 80#define S3C_PA_IIC S5PV210_PA_IIC0
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index ab4869df30c0..6f9fd3274e2e 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -72,6 +72,8 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
72}; 72};
73 73
74static struct platform_device *smdkc110_devices[] __initdata = { 74static struct platform_device *smdkc110_devices[] __initdata = {
75 &s5pv210_device_iis0,
76 &s5pv210_device_ac97,
75}; 77};
76 78
77static void __init smdkc110_map_io(void) 79static void __init smdkc110_map_io(void)
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index a27883253204..3c29e18528a5 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -72,6 +72,8 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
72}; 72};
73 73
74static struct platform_device *smdkv210_devices[] __initdata = { 74static struct platform_device *smdkv210_devices[] __initdata = {
75 &s5pv210_device_iis0,
76 &s5pv210_device_ac97,
75}; 77};
76 78
77static void __init smdkv210_map_io(void) 79static void __init smdkv210_map_io(void)
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 796d24258313..ef69e56b2885 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -64,6 +64,22 @@ extern struct platform_device s3c_device_nand;
64extern struct platform_device s3c_device_usbgadget; 64extern struct platform_device s3c_device_usbgadget;
65extern struct platform_device s3c_device_usb_hsotg; 65extern struct platform_device s3c_device_usb_hsotg;
66 66
67extern struct platform_device s5pv210_device_ac97;
68extern struct platform_device s5pv210_device_pcm0;
69extern struct platform_device s5pv210_device_pcm1;
70extern struct platform_device s5pv210_device_pcm2;
71extern struct platform_device s5pv210_device_iis0;
72extern struct platform_device s5pv210_device_iis1;
73extern struct platform_device s5pv210_device_iis2;
74
75extern struct platform_device s5p6442_device_pcm0;
76extern struct platform_device s5p6442_device_pcm1;
77extern struct platform_device s5p6442_device_iis0;
78extern struct platform_device s5p6442_device_iis1;
79
80extern struct platform_device s5p6440_device_pcm;
81extern struct platform_device s5p6440_device_iis;
82
67/* s3c2440 specific devices */ 83/* s3c2440 specific devices */
68 84
69#ifdef CONFIG_CPU_S3C2440 85#ifdef CONFIG_CPU_S3C2440