diff options
Diffstat (limited to 'arch/arm/mach-s5pv210/dev-audio.c')
-rw-r--r-- | arch/arm/mach-s5pv210/dev-audio.c | 86 |
1 files changed, 47 insertions, 39 deletions
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c index 21dc6cf955c3..1303fcb12b51 100644 --- a/arch/arm/mach-s5pv210/dev-audio.c +++ b/arch/arm/mach-s5pv210/dev-audio.c | |||
@@ -24,29 +24,15 @@ static int s5pv210_cfg_i2s(struct platform_device *pdev) | |||
24 | /* configure GPIO for i2s port */ | 24 | /* configure GPIO for i2s port */ |
25 | switch (pdev->id) { | 25 | switch (pdev->id) { |
26 | case 1: | 26 | case 1: |
27 | s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(2)); | 27 | s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, 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; | 28 | break; |
33 | 29 | ||
34 | case 2: | 30 | case 2: |
35 | s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(4)); | 31 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, 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; | 32 | break; |
41 | 33 | ||
42 | case -1: | 34 | case -1: |
43 | s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(2)); | 35 | s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, 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; | 36 | break; |
51 | 37 | ||
52 | default: | 38 | default: |
@@ -151,25 +137,13 @@ static int s5pv210_pcm_cfg_gpio(struct platform_device *pdev) | |||
151 | { | 137 | { |
152 | switch (pdev->id) { | 138 | switch (pdev->id) { |
153 | case 0: | 139 | case 0: |
154 | s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(3)); | 140 | s3c_gpio_cfgpin_range(S5PV210_GPI(0), 5, 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; | 141 | break; |
160 | case 1: | 142 | case 1: |
161 | s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(3)); | 143 | s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, 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; | 144 | break; |
167 | case 2: | 145 | case 2: |
168 | s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(2)); | 146 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, 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; | 147 | break; |
174 | default: | 148 | default: |
175 | printk(KERN_DEBUG "Invalid PCM Controller number!"); | 149 | printk(KERN_DEBUG "Invalid PCM Controller number!"); |
@@ -271,13 +245,7 @@ struct platform_device s5pv210_device_pcm2 = { | |||
271 | 245 | ||
272 | static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev) | 246 | static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev) |
273 | { | 247 | { |
274 | s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(4)); | 248 | return s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, 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 | } | 249 | } |
282 | 250 | ||
283 | static struct resource s5pv210_ac97_resource[] = { | 251 | static struct resource s5pv210_ac97_resource[] = { |
@@ -325,3 +293,43 @@ struct platform_device s5pv210_device_ac97 = { | |||
325 | .coherent_dma_mask = DMA_BIT_MASK(32), | 293 | .coherent_dma_mask = DMA_BIT_MASK(32), |
326 | }, | 294 | }, |
327 | }; | 295 | }; |
296 | |||
297 | /* S/PDIF Controller platform_device */ | ||
298 | |||
299 | static int s5pv210_spdif_cfg_gpio(struct platform_device *pdev) | ||
300 | { | ||
301 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 2, S3C_GPIO_SFN(3)); | ||
302 | |||
303 | return 0; | ||
304 | } | ||
305 | |||
306 | static struct resource s5pv210_spdif_resource[] = { | ||
307 | [0] = { | ||
308 | .start = S5PV210_PA_SPDIF, | ||
309 | .end = S5PV210_PA_SPDIF + 0x100 - 1, | ||
310 | .flags = IORESOURCE_MEM, | ||
311 | }, | ||
312 | [1] = { | ||
313 | .start = DMACH_SPDIF, | ||
314 | .end = DMACH_SPDIF, | ||
315 | .flags = IORESOURCE_DMA, | ||
316 | }, | ||
317 | }; | ||
318 | |||
319 | static struct s3c_audio_pdata samsung_spdif_pdata = { | ||
320 | .cfg_gpio = s5pv210_spdif_cfg_gpio, | ||
321 | }; | ||
322 | |||
323 | static u64 s5pv210_spdif_dmamask = DMA_BIT_MASK(32); | ||
324 | |||
325 | struct platform_device s5pv210_device_spdif = { | ||
326 | .name = "samsung-spdif", | ||
327 | .id = -1, | ||
328 | .num_resources = ARRAY_SIZE(s5pv210_spdif_resource), | ||
329 | .resource = s5pv210_spdif_resource, | ||
330 | .dev = { | ||
331 | .platform_data = &samsung_spdif_pdata, | ||
332 | .dma_mask = &s5pv210_spdif_dmamask, | ||
333 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
334 | }, | ||
335 | }; | ||