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 <linux/platform_data/asoc-s3c.h>
20 #include <mach/irqs.h>
22 static int s5p6440_cfg_i2s(struct platform_device
*pdev
)
26 s3c_gpio_cfgpin_range(S5P6440_GPC(4), 2, S3C_GPIO_SFN(5));
27 s3c_gpio_cfgpin(S5P6440_GPC(7), S3C_GPIO_SFN(5));
28 s3c_gpio_cfgpin_range(S5P6440_GPH(6), 4, S3C_GPIO_SFN(5));
31 printk(KERN_ERR
"Invalid Device %d\n", pdev
->id
);
38 static struct s3c_audio_pdata s5p6440_i2s_pdata
= {
39 .cfg_gpio
= s5p6440_cfg_i2s
,
42 .quirks
= QUIRK_PRI_6CHAN
,
47 static struct resource s5p64x0_i2s0_resource
[] = {
48 [0] = DEFINE_RES_MEM(S5P64X0_PA_I2S
, SZ_256
),
49 [1] = DEFINE_RES_DMA(DMACH_I2S0_TX
),
50 [2] = DEFINE_RES_DMA(DMACH_I2S0_RX
),
53 struct platform_device s5p6440_device_iis
= {
54 .name
= "samsung-i2s",
56 .num_resources
= ARRAY_SIZE(s5p64x0_i2s0_resource
),
57 .resource
= s5p64x0_i2s0_resource
,
59 .platform_data
= &s5p6440_i2s_pdata
,
63 static int s5p6450_cfg_i2s(struct platform_device
*pdev
)
67 s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5));
68 s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5));
71 s3c_gpio_cfgpin(S5P6440_GPB(4), S3C_GPIO_SFN(5));
72 s3c_gpio_cfgpin_range(S5P6450_GPC(0), 4, S3C_GPIO_SFN(5));
75 s3c_gpio_cfgpin_range(S5P6450_GPK(0), 5, S3C_GPIO_SFN(5));
78 printk(KERN_ERR
"Invalid Device %d\n", pdev
->id
);
85 static struct s3c_audio_pdata s5p6450_i2s0_pdata
= {
86 .cfg_gpio
= s5p6450_cfg_i2s
,
89 .quirks
= QUIRK_PRI_6CHAN
,
94 struct platform_device s5p6450_device_iis0
= {
95 .name
= "samsung-i2s",
97 .num_resources
= ARRAY_SIZE(s5p64x0_i2s0_resource
),
98 .resource
= s5p64x0_i2s0_resource
,
100 .platform_data
= &s5p6450_i2s0_pdata
,
104 static struct s3c_audio_pdata s5p6450_i2s_pdata
= {
105 .cfg_gpio
= s5p6450_cfg_i2s
,
108 static struct resource s5p6450_i2s1_resource
[] = {
109 [0] = DEFINE_RES_MEM(S5P6450_PA_I2S1
, SZ_256
),
110 [1] = DEFINE_RES_DMA(DMACH_I2S1_TX
),
111 [2] = DEFINE_RES_DMA(DMACH_I2S1_RX
),
114 struct platform_device s5p6450_device_iis1
= {
115 .name
= "samsung-i2s",
117 .num_resources
= ARRAY_SIZE(s5p6450_i2s1_resource
),
118 .resource
= s5p6450_i2s1_resource
,
120 .platform_data
= &s5p6450_i2s_pdata
,
124 static struct resource s5p6450_i2s2_resource
[] = {
125 [0] = DEFINE_RES_MEM(S5P6450_PA_I2S2
, SZ_256
),
126 [1] = DEFINE_RES_DMA(DMACH_I2S2_TX
),
127 [2] = DEFINE_RES_DMA(DMACH_I2S2_RX
),
130 struct platform_device s5p6450_device_iis2
= {
131 .name
= "samsung-i2s",
133 .num_resources
= ARRAY_SIZE(s5p6450_i2s2_resource
),
134 .resource
= s5p6450_i2s2_resource
,
136 .platform_data
= &s5p6450_i2s_pdata
,
140 /* PCM Controller platform_devices */
142 static int s5p6440_pcm_cfg_gpio(struct platform_device
*pdev
)
146 s3c_gpio_cfgpin_range(S5P6440_GPR(6), 3, S3C_GPIO_SFN(2));
147 s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(2));
151 printk(KERN_DEBUG
"Invalid PCM Controller number!");
158 static struct s3c_audio_pdata s5p6440_pcm_pdata
= {
159 .cfg_gpio
= s5p6440_pcm_cfg_gpio
,
162 static struct resource s5p6440_pcm0_resource
[] = {
163 [0] = DEFINE_RES_MEM(S5P64X0_PA_PCM
, SZ_256
),
164 [1] = DEFINE_RES_DMA(DMACH_PCM0_TX
),
165 [2] = DEFINE_RES_DMA(DMACH_PCM0_RX
),
168 struct platform_device s5p6440_device_pcm
= {
169 .name
= "samsung-pcm",
171 .num_resources
= ARRAY_SIZE(s5p6440_pcm0_resource
),
172 .resource
= s5p6440_pcm0_resource
,
174 .platform_data
= &s5p6440_pcm_pdata
,