diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:05:33 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:05:33 -0400 |
commit | 1770a8988f6178efdc1bfc85fb29deacac49fe91 (patch) | |
tree | b20b8da8b92e388847a55e7c7da9d919fe3f3abb /arch/arm/mach-s5p6442 | |
parent | 1e8ff636beb6ee5c87868a6081cc4f95b1ccd713 (diff) | |
parent | 734552072335b00476b626b027ca4a9f57147b6f (diff) |
ARM: Merge for-2635/s5p-audio
Merge branch 'for-2635/s5p-audio' into for-linus/samsung2
Diffstat (limited to 'arch/arm/mach-s5p6442')
-rw-r--r-- | arch/arm/mach-s5p6442/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5p6442/dev-audio.c | 197 | ||||
-rw-r--r-- | arch/arm/mach-s5p6442/include/mach/map.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-s5p6442/mach-smdk6442.c | 1 |
4 files changed, 209 insertions, 0 deletions
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 | ||
19 | obj-$(CONFIG_MACH_SMDK6442) += mach-smdk6442.o | 19 | obj-$(CONFIG_MACH_SMDK6442) += mach-smdk6442.o |
20 | |||
21 | # device support | ||
22 | obj-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 | |||
22 | static 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 | |||
50 | static struct s3c_audio_pdata s3c_i2s_pdata = { | ||
51 | .cfg_gpio = s5p6442_cfg_i2s, | ||
52 | }; | ||
53 | |||
54 | static 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 | |||
72 | struct 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 | |||
82 | static 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 | |||
100 | struct 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 | |||
112 | static 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 | |||
139 | static struct s3c_audio_pdata s3c_pcm_pdata = { | ||
140 | .cfg_gpio = s5p6442_pcm_cfg_gpio, | ||
141 | }; | ||
142 | |||
143 | static 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 | |||
161 | struct 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 | |||
171 | static 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 | |||
189 | struct 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 | ||
67 | static struct platform_device *smdk6442_devices[] __initdata = { | 67 | static struct platform_device *smdk6442_devices[] __initdata = { |
68 | &s5p6442_device_iis0, | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | static void __init smdk6442_map_io(void) | 71 | static void __init smdk6442_map_io(void) |