1 /* linux/arch/arm/plat-s3c/dev-audio.c
3 * Copyright 2009 Wolfson Microelectronics
4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/string.h>
14 #include <linux/platform_device.h>
16 #include <mach/irqs.h>
19 #include <mach/gpio.h>
21 #include <plat/devs.h>
22 #include <plat/audio.h>
23 #include <plat/gpio-bank-d.h>
24 #include <plat/gpio-bank-e.h>
25 #include <plat/gpio-cfg.h>
27 static struct resource s3c64xx_iis0_resource
[] = {
29 .start
= S3C64XX_PA_IIS0
,
30 .end
= S3C64XX_PA_IIS0
+ 0x100 - 1,
31 .flags
= IORESOURCE_MEM
,
35 struct platform_device s3c64xx_device_iis0
= {
36 .name
= "s3c64xx-iis",
38 .num_resources
= ARRAY_SIZE(s3c64xx_iis0_resource
),
39 .resource
= s3c64xx_iis0_resource
,
41 EXPORT_SYMBOL(s3c64xx_device_iis0
);
43 static struct resource s3c64xx_iis1_resource
[] = {
45 .start
= S3C64XX_PA_IIS1
,
46 .end
= S3C64XX_PA_IIS1
+ 0x100 - 1,
47 .flags
= IORESOURCE_MEM
,
51 struct platform_device s3c64xx_device_iis1
= {
52 .name
= "s3c64xx-iis",
54 .num_resources
= ARRAY_SIZE(s3c64xx_iis1_resource
),
55 .resource
= s3c64xx_iis1_resource
,
57 EXPORT_SYMBOL(s3c64xx_device_iis1
);
59 static struct resource s3c64xx_iisv4_resource
[] = {
61 .start
= S3C64XX_PA_IISV4
,
62 .end
= S3C64XX_PA_IISV4
+ 0x100 - 1,
63 .flags
= IORESOURCE_MEM
,
67 struct platform_device s3c64xx_device_iisv4
= {
68 .name
= "s3c64xx-iis-v4",
70 .num_resources
= ARRAY_SIZE(s3c64xx_iisv4_resource
),
71 .resource
= s3c64xx_iisv4_resource
,
73 EXPORT_SYMBOL(s3c64xx_device_iisv4
);
76 /* PCM Controller platform_devices */
78 static int s3c64xx_pcm_cfg_gpio(struct platform_device
*pdev
)
82 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK
);
83 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK
);
84 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC
);
85 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN
);
86 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT
);
89 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK
);
90 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK
);
91 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC
);
92 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN
);
93 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT
);
96 printk(KERN_DEBUG
"Invalid PCM Controller number!");
103 static struct resource s3c64xx_pcm0_resource
[] = {
105 .start
= S3C64XX_PA_PCM0
,
106 .end
= S3C64XX_PA_PCM0
+ 0x100 - 1,
107 .flags
= IORESOURCE_MEM
,
110 .start
= DMACH_PCM0_TX
,
111 .end
= DMACH_PCM0_TX
,
112 .flags
= IORESOURCE_DMA
,
115 .start
= DMACH_PCM0_RX
,
116 .end
= DMACH_PCM0_RX
,
117 .flags
= IORESOURCE_DMA
,
121 static struct s3c_audio_pdata s3c_pcm0_pdata
= {
122 .cfg_gpio
= s3c64xx_pcm_cfg_gpio
,
125 struct platform_device s3c64xx_device_pcm0
= {
126 .name
= "samsung-pcm",
128 .num_resources
= ARRAY_SIZE(s3c64xx_pcm0_resource
),
129 .resource
= s3c64xx_pcm0_resource
,
131 .platform_data
= &s3c_pcm0_pdata
,
134 EXPORT_SYMBOL(s3c64xx_device_pcm0
);
136 static struct resource s3c64xx_pcm1_resource
[] = {
138 .start
= S3C64XX_PA_PCM1
,
139 .end
= S3C64XX_PA_PCM1
+ 0x100 - 1,
140 .flags
= IORESOURCE_MEM
,
143 .start
= DMACH_PCM1_TX
,
144 .end
= DMACH_PCM1_TX
,
145 .flags
= IORESOURCE_DMA
,
148 .start
= DMACH_PCM1_RX
,
149 .end
= DMACH_PCM1_RX
,
150 .flags
= IORESOURCE_DMA
,
154 static struct s3c_audio_pdata s3c_pcm1_pdata
= {
155 .cfg_gpio
= s3c64xx_pcm_cfg_gpio
,
158 struct platform_device s3c64xx_device_pcm1
= {
159 .name
= "samsung-pcm",
161 .num_resources
= ARRAY_SIZE(s3c64xx_pcm1_resource
),
162 .resource
= s3c64xx_pcm1_resource
,
164 .platform_data
= &s3c_pcm1_pdata
,
167 EXPORT_SYMBOL(s3c64xx_device_pcm1
);