1 /* linux/arch/arm/mach-s5p6440/dev-audio.c
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
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.
11 #include <linux/platform_device.h>
12 #include <linux/dma-mapping.h>
14 #include <plat/gpio-cfg.h>
15 #include <plat/audio.h>
17 #include <mach/gpio.h>
20 #include <mach/irqs.h>
22 static int s5p6440_cfg_i2s(struct platform_device
*pdev
)
24 /* configure GPIO for i2s port */
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));
37 printk(KERN_ERR
"Invalid Device %d\n", pdev
->id
);
44 static struct s3c_audio_pdata s3c_i2s_pdata
= {
45 .cfg_gpio
= s5p6440_cfg_i2s
,
48 static struct resource s5p6440_iis0_resource
[] = {
50 .start
= S5P6440_PA_I2S
,
51 .end
= S5P6440_PA_I2S
+ 0x100 - 1,
52 .flags
= IORESOURCE_MEM
,
55 .start
= DMACH_I2S0_TX
,
57 .flags
= IORESOURCE_DMA
,
60 .start
= DMACH_I2S0_RX
,
62 .flags
= IORESOURCE_DMA
,
66 struct platform_device s5p6440_device_iis
= {
67 .name
= "s3c64xx-iis-v4",
69 .num_resources
= ARRAY_SIZE(s5p6440_iis0_resource
),
70 .resource
= s5p6440_iis0_resource
,
72 .platform_data
= &s3c_i2s_pdata
,
76 /* PCM Controller platform_devices */
78 static int s5p6440_pcm_cfg_gpio(struct platform_device
*pdev
)
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));
90 printk(KERN_DEBUG
"Invalid PCM Controller number!");
97 static struct s3c_audio_pdata s3c_pcm_pdata
= {
98 .cfg_gpio
= s5p6440_pcm_cfg_gpio
,
101 static struct resource s5p6440_pcm0_resource
[] = {
103 .start
= S5P6440_PA_PCM
,
104 .end
= S5P6440_PA_PCM
+ 0x100 - 1,
105 .flags
= IORESOURCE_MEM
,
108 .start
= DMACH_PCM0_TX
,
109 .end
= DMACH_PCM0_TX
,
110 .flags
= IORESOURCE_DMA
,
113 .start
= DMACH_PCM0_RX
,
114 .end
= DMACH_PCM0_RX
,
115 .flags
= IORESOURCE_DMA
,
119 struct platform_device s5p6440_device_pcm
= {
120 .name
= "samsung-pcm",
122 .num_resources
= ARRAY_SIZE(s5p6440_pcm0_resource
),
123 .resource
= s5p6440_pcm0_resource
,
125 .platform_data
= &s3c_pcm_pdata
,