1 /* linux/arch/arm/mach-s5p6442/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 int s5p6442_cfg_i2s(struct platform_device *pdev)
26 /* configure GPIO for i2s port */
29 base = S5P6442_GPC1(0);
33 base = S5P6442_GPC0(0);
37 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
41 s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(2));
45 static struct s3c_audio_pdata s3c_i2s_pdata = {
46 .cfg_gpio = s5p6442_cfg_i2s,
49 static struct resource s5p6442_iis0_resource[] = {
51 .start = S5P6442_PA_I2S0,
52 .end = S5P6442_PA_I2S0 + 0x100 - 1,
53 .flags = IORESOURCE_MEM,
56 .start = DMACH_I2S0_TX,
58 .flags = IORESOURCE_DMA,
61 .start = DMACH_I2S0_RX,
63 .flags = IORESOURCE_DMA,
67 struct platform_device s5p6442_device_iis0 = {
68 .name = "s3c64xx-iis-v4",
70 .num_resources = ARRAY_SIZE(s5p6442_iis0_resource),
71 .resource = s5p6442_iis0_resource,
73 .platform_data = &s3c_i2s_pdata,
77 static struct resource s5p6442_iis1_resource[] = {
79 .start = S5P6442_PA_I2S1,
80 .end = S5P6442_PA_I2S1 + 0x100 - 1,
81 .flags = IORESOURCE_MEM,
84 .start = DMACH_I2S1_TX,
86 .flags = IORESOURCE_DMA,
89 .start = DMACH_I2S1_RX,
91 .flags = IORESOURCE_DMA,
95 struct platform_device s5p6442_device_iis1 = {
96 .name = "s3c64xx-iis",
98 .num_resources = ARRAY_SIZE(s5p6442_iis1_resource),
99 .resource = s5p6442_iis1_resource,
101 .platform_data = &s3c_i2s_pdata,
105 /* PCM Controller platform_devices */
107 static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
113 base = S5P6442_GPC0(0);
117 base = S5P6442_GPC1(0);
121 printk(KERN_DEBUG "Invalid PCM Controller number!");
125 s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3));
129 static struct s3c_audio_pdata s3c_pcm_pdata = {
130 .cfg_gpio = s5p6442_pcm_cfg_gpio,
133 static struct resource s5p6442_pcm0_resource[] = {
135 .start = S5P6442_PA_PCM0,
136 .end = S5P6442_PA_PCM0 + 0x100 - 1,
137 .flags = IORESOURCE_MEM,
140 .start = DMACH_PCM0_TX,
141 .end = DMACH_PCM0_TX,
142 .flags = IORESOURCE_DMA,
145 .start = DMACH_PCM0_RX,
146 .end = DMACH_PCM0_RX,
147 .flags = IORESOURCE_DMA,
151 struct platform_device s5p6442_device_pcm0 = {
152 .name = "samsung-pcm",
154 .num_resources = ARRAY_SIZE(s5p6442_pcm0_resource),
155 .resource = s5p6442_pcm0_resource,
157 .platform_data = &s3c_pcm_pdata,
161 static struct resource s5p6442_pcm1_resource[] = {
163 .start = S5P6442_PA_PCM1,
164 .end = S5P6442_PA_PCM1 + 0x100 - 1,
165 .flags = IORESOURCE_MEM,
168 .start = DMACH_PCM1_TX,
169 .end = DMACH_PCM1_TX,
170 .flags = IORESOURCE_DMA,
173 .start = DMACH_PCM1_RX,
174 .end = DMACH_PCM1_RX,
175 .flags = IORESOURCE_DMA,
179 struct platform_device s5p6442_device_pcm1 = {
180 .name = "samsung-pcm",
182 .num_resources = ARRAY_SIZE(s5p6442_pcm1_resource),
183 .resource = s5p6442_pcm1_resource,
185 .platform_data = &s3c_pcm_pdata,