aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5p64x0/dev-audio.c
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-11-18 18:49:44 -0500
committerKukjin Kim <kgene.kim@samsung.com>2010-11-18 18:49:44 -0500
commitd9a93c345a5503668ca2b3a75be0eba1131c90e4 (patch)
tree93df188933c3fa8525e03d3b13461a98df8e1b78 /arch/arm/mach-s5p64x0/dev-audio.c
parent6a62bee2105250ac02bf3c96b7f35e28dac36888 (diff)
ARM: S5P64X0: Upgrade platform device for I2S
Add more information to I2S platform_devices in order to prepare them for new controller driver. Also, discard duplicated gpio-cfg. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5p64x0/dev-audio.c')
-rw-r--r--arch/arm/mach-s5p64x0/dev-audio.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/arch/arm/mach-s5p64x0/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c
index fb613d0f3808..14f89e73b8de 100644
--- a/arch/arm/mach-s5p64x0/dev-audio.c
+++ b/arch/arm/mach-s5p64x0/dev-audio.c
@@ -19,15 +19,19 @@
19#include <mach/dma.h> 19#include <mach/dma.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21 21
22static int s5p6440_cfg_i2s(struct platform_device *pdev) 22static const char *rclksrc[] = {
23 [0] = "iis",
24 [1] = "sclk_audio2",
25};
26
27static int s5p64x0_cfg_i2s(struct platform_device *pdev)
23{ 28{
24 /* configure GPIO for i2s port */ 29 /* configure GPIO for i2s port */
25 switch (pdev->id) { 30 switch (pdev->id) {
26 case -1: 31 case 0:
27 s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5)); 32 s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5));
28 s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5)); 33 s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5));
29 break; 34 break;
30
31 default: 35 default:
32 printk(KERN_ERR "Invalid Device %d\n", pdev->id); 36 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
33 return -EINVAL; 37 return -EINVAL;
@@ -36,31 +40,14 @@ static int s5p6440_cfg_i2s(struct platform_device *pdev)
36 return 0; 40 return 0;
37} 41}
38 42
39static int s5p6450_cfg_i2s(struct platform_device *pdev) 43static struct s3c_audio_pdata s5p64x0_i2s_pdata = {
40{ 44 .cfg_gpio = s5p64x0_cfg_i2s,
41 /* configure GPIO for i2s port */ 45 .type = {
42 switch (pdev->id) { 46 .i2s = {
43 case -1: 47 .quirks = QUIRK_PRI_6CHAN,
44 s3c_gpio_cfgpin(S5P6450_GPB(4), S3C_GPIO_SFN(5)); 48 .src_clk = rclksrc,
45 s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5)); 49 },
46 s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5)); 50 },
47
48 break;
49
50 default:
51 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
52 return -EINVAL;
53 }
54
55 return 0;
56}
57
58static struct s3c_audio_pdata s5p6440_i2s_pdata = {
59 .cfg_gpio = s5p6440_cfg_i2s,
60};
61
62static struct s3c_audio_pdata s5p6450_i2s_pdata = {
63 .cfg_gpio = s5p6450_cfg_i2s,
64}; 51};
65 52
66static struct resource s5p64x0_iis0_resource[] = { 53static struct resource s5p64x0_iis0_resource[] = {
@@ -82,22 +69,22 @@ static struct resource s5p64x0_iis0_resource[] = {
82}; 69};
83 70
84struct platform_device s5p6440_device_iis = { 71struct platform_device s5p6440_device_iis = {
85 .name = "samsung-i2s-v4", 72 .name = "samsung-i2s",
86 .id = -1, 73 .id = 0,
87 .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), 74 .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource),
88 .resource = s5p64x0_iis0_resource, 75 .resource = s5p64x0_iis0_resource,
89 .dev = { 76 .dev = {
90 .platform_data = &s5p6440_i2s_pdata, 77 .platform_data = &s5p64x0_i2s_pdata,
91 }, 78 },
92}; 79};
93 80
94struct platform_device s5p6450_device_iis0 = { 81struct platform_device s5p6450_device_iis0 = {
95 .name = "samsung-i2s-v4", 82 .name = "samsung-i2s",
96 .id = -1, 83 .id = 0,
97 .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), 84 .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource),
98 .resource = s5p64x0_iis0_resource, 85 .resource = s5p64x0_iis0_resource,
99 .dev = { 86 .dev = {
100 .platform_data = &s5p6450_i2s_pdata, 87 .platform_data = &s5p64x0_i2s_pdata,
101 }, 88 },
102}; 89};
103 90