1 /* linux/arch/arm/mach-s5p64x0/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>
13 #include <linux/gpio.h>
15 #include <plat/gpio-cfg.h>
16 #include <plat/audio.h>
20 #include <mach/irqs.h>
22 static const char *rclksrc
[] = {
27 static int s5p6440_cfg_i2s(struct platform_device
*pdev
)
31 s3c_gpio_cfgpin_range(S5P6440_GPC(4), 2, S3C_GPIO_SFN(5));
32 s3c_gpio_cfgpin(S5P6440_GPC(7), S3C_GPIO_SFN(5));
33 s3c_gpio_cfgpin_range(S5P6440_GPH(6), 4, S3C_GPIO_SFN(5));
36 printk(KERN_ERR
"Invalid Device %d\n", pdev
->id
);
43 static struct s3c_audio_pdata s5p6440_i2s_pdata
= {
44 .cfg_gpio
= s5p6440_cfg_i2s
,
47 .quirks
= QUIRK_PRI_6CHAN
,
53 static struct resource s5p64x0_i2s0_resource
[] = {
55 .start
= S5P64X0_PA_I2S
,
56 .end
= S5P64X0_PA_I2S
+ 0x100 - 1,
57 .flags
= IORESOURCE_MEM
,
60 .start
= DMACH_I2S0_TX
,
62 .flags
= IORESOURCE_DMA
,
65 .start
= DMACH_I2S0_RX
,
67 .flags
= IORESOURCE_DMA
,
71 struct platform_device s5p6440_device_iis
= {
72 .name
= "samsung-i2s",
74 .num_resources
= ARRAY_SIZE(s5p64x0_i2s0_resource
),
75 .resource
= s5p64x0_i2s0_resource
,
77 .platform_data
= &s5p6440_i2s_pdata
,
81 static int s5p6450_cfg_i2s(struct platform_device
*pdev
)
85 s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5));
86 s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5));
89 s3c_gpio_cfgpin(S5P6440_GPB(4), S3C_GPIO_SFN(5));
90 s3c_gpio_cfgpin_range(S5P6450_GPC(0), 4, S3C_GPIO_SFN(5));
93 s3c_gpio_cfgpin_range(S5P6450_GPK(0), 5, S3C_GPIO_SFN(5));
96 printk(KERN_ERR
"Invalid Device %d\n", pdev
->id
);
103 static struct s3c_audio_pdata s5p6450_i2s0_pdata
= {
104 .cfg_gpio
= s5p6450_cfg_i2s
,
107 .quirks
= QUIRK_PRI_6CHAN
,
113 struct platform_device s5p6450_device_iis0
= {
114 .name
= "samsung-i2s",
116 .num_resources
= ARRAY_SIZE(s5p64x0_i2s0_resource
),
117 .resource
= s5p64x0_i2s0_resource
,
119 .platform_data
= &s5p6450_i2s0_pdata
,
123 static struct s3c_audio_pdata s5p6450_i2s_pdata
= {
124 .cfg_gpio
= s5p6450_cfg_i2s
,
132 static struct resource s5p6450_i2s1_resource
[] = {
134 .start
= S5P6450_PA_I2S1
,
135 .end
= S5P6450_PA_I2S1
+ 0x100 - 1,
136 .flags
= IORESOURCE_MEM
,
139 .start
= DMACH_I2S1_TX
,
140 .end
= DMACH_I2S1_TX
,
141 .flags
= IORESOURCE_DMA
,
144 .start
= DMACH_I2S1_RX
,
145 .end
= DMACH_I2S1_RX
,
146 .flags
= IORESOURCE_DMA
,
150 struct platform_device s5p6450_device_iis1
= {
151 .name
= "samsung-i2s",
153 .num_resources
= ARRAY_SIZE(s5p6450_i2s1_resource
),
154 .resource
= s5p6450_i2s1_resource
,
156 .platform_data
= &s5p6450_i2s_pdata
,
160 static struct resource s5p6450_i2s2_resource
[] = {
162 .start
= S5P6450_PA_I2S2
,
163 .end
= S5P6450_PA_I2S2
+ 0x100 - 1,
164 .flags
= IORESOURCE_MEM
,
167 .start
= DMACH_I2S2_TX
,
168 .end
= DMACH_I2S2_TX
,
169 .flags
= IORESOURCE_DMA
,
172 .start
= DMACH_I2S2_RX
,
173 .end
= DMACH_I2S2_RX
,
174 .flags
= IORESOURCE_DMA
,
178 struct platform_device s5p6450_device_iis2
= {
179 .name
= "samsung-i2s",
181 .num_resources
= ARRAY_SIZE(s5p6450_i2s2_resource
),
182 .resource
= s5p6450_i2s2_resource
,
184 .platform_data
= &s5p6450_i2s_pdata
,
188 /* PCM Controller platform_devices */
190 static int s5p6440_pcm_cfg_gpio(struct platform_device
*pdev
)
194 s3c_gpio_cfgpin_range(S5P6440_GPR(6), 3, S3C_GPIO_SFN(2));
195 s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(2));
199 printk(KERN_DEBUG
"Invalid PCM Controller number!");
206 static struct s3c_audio_pdata s5p6440_pcm_pdata
= {
207 .cfg_gpio
= s5p6440_pcm_cfg_gpio
,
210 static struct resource s5p6440_pcm0_resource
[] = {
212 .start
= S5P64X0_PA_PCM
,
213 .end
= S5P64X0_PA_PCM
+ 0x100 - 1,
214 .flags
= IORESOURCE_MEM
,
217 .start
= DMACH_PCM0_TX
,
218 .end
= DMACH_PCM0_TX
,
219 .flags
= IORESOURCE_DMA
,
222 .start
= DMACH_PCM0_RX
,
223 .end
= DMACH_PCM0_RX
,
224 .flags
= IORESOURCE_DMA
,
228 struct platform_device s5p6440_device_pcm
= {
229 .name
= "samsung-pcm",
231 .num_resources
= ARRAY_SIZE(s5p6440_pcm0_resource
),
232 .resource
= s5p6440_pcm0_resource
,
234 .platform_data
= &s5p6440_pcm_pdata
,