aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c64xx
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-01-06 01:33:44 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-17 18:47:21 -0500
commit71269364a8d5ea42ecc6cbc7b687e5d45cbabe0e (patch)
treee6def0893cc64c0e64f846c2d72dbc846d5574a4 /arch/arm/plat-s3c64xx
parent206090913d0d6ad3506e3e2693a696fc1626993e (diff)
ARM: S3C64XX: Add I2S resources in platform code
Define resources needed by the I2S drivers in platform code. Audio cfg_gpio callback and IORESOURCE_DMA are added. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c64xx')
-rw-r--r--arch/arm/plat-s3c64xx/dev-audio.c91
1 files changed, 90 insertions, 1 deletions
diff --git a/arch/arm/plat-s3c64xx/dev-audio.c b/arch/arm/plat-s3c64xx/dev-audio.c
index a21a88fbb7e3..cdba3a77ea19 100644
--- a/arch/arm/plat-s3c64xx/dev-audio.c
+++ b/arch/arm/plat-s3c64xx/dev-audio.c
@@ -3,7 +3,6 @@
3 * Copyright 2009 Wolfson Microelectronics 3 * Copyright 2009 Wolfson Microelectronics
4 * Mark Brown <broonie@opensource.wolfsonmicro.com> 4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
5 * 5 *
6
7 * This program is free software; you can redistribute it and/or modify 6 * 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 7 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
@@ -20,16 +19,69 @@
20 19
21#include <plat/devs.h> 20#include <plat/devs.h>
22#include <plat/audio.h> 21#include <plat/audio.h>
22#include <plat/gpio-bank-c.h>
23#include <plat/gpio-bank-d.h> 23#include <plat/gpio-bank-d.h>
24#include <plat/gpio-bank-e.h> 24#include <plat/gpio-bank-e.h>
25#include <plat/gpio-bank-h.h>
25#include <plat/gpio-cfg.h> 26#include <plat/gpio-cfg.h>
26 27
28static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
29{
30 switch (pdev->id) {
31 case 0:
32 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_I2S0_CLK);
33 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_I2S0_CDCLK);
34 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_I2S0_LRCLK);
35 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_I2S0_DI);
36 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_I2S0_D0);
37 break;
38 case 1:
39 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_I2S1_CLK);
40 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_I2S1_CDCLK);
41 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_I2S1_LRCLK);
42 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_I2S1_DI);
43 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_I2S1_D0);
44 default:
45 printk(KERN_DEBUG "Invalid I2S Controller number!");
46 return -EINVAL;
47 }
48
49 return 0;
50}
51
52static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
53{
54 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S0_V40_DO);
55 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S1_V40_DO);
56 s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S2_V40_DO);
57 s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK);
58 s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);
59 s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
60 s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
61
62 return 0;
63}
64
27static struct resource s3c64xx_iis0_resource[] = { 65static struct resource s3c64xx_iis0_resource[] = {
28 [0] = { 66 [0] = {
29 .start = S3C64XX_PA_IIS0, 67 .start = S3C64XX_PA_IIS0,
30 .end = S3C64XX_PA_IIS0 + 0x100 - 1, 68 .end = S3C64XX_PA_IIS0 + 0x100 - 1,
31 .flags = IORESOURCE_MEM, 69 .flags = IORESOURCE_MEM,
32 }, 70 },
71 [1] = {
72 .start = DMACH_I2S0_OUT,
73 .end = DMACH_I2S0_OUT,
74 .flags = IORESOURCE_DMA,
75 },
76 [2] = {
77 .start = DMACH_I2S0_IN,
78 .end = DMACH_I2S0_IN,
79 .flags = IORESOURCE_DMA,
80 },
81};
82
83struct s3c_audio_pdata s3c_i2s0_pdata = {
84 .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
33}; 85};
34 86
35struct platform_device s3c64xx_device_iis0 = { 87struct platform_device s3c64xx_device_iis0 = {
@@ -37,6 +89,9 @@ struct platform_device s3c64xx_device_iis0 = {
37 .id = 0, 89 .id = 0,
38 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource), 90 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
39 .resource = s3c64xx_iis0_resource, 91 .resource = s3c64xx_iis0_resource,
92 .dev = {
93 .platform_data = &s3c_i2s0_pdata,
94 },
40}; 95};
41EXPORT_SYMBOL(s3c64xx_device_iis0); 96EXPORT_SYMBOL(s3c64xx_device_iis0);
42 97
@@ -46,6 +101,20 @@ static struct resource s3c64xx_iis1_resource[] = {
46 .end = S3C64XX_PA_IIS1 + 0x100 - 1, 101 .end = S3C64XX_PA_IIS1 + 0x100 - 1,
47 .flags = IORESOURCE_MEM, 102 .flags = IORESOURCE_MEM,
48 }, 103 },
104 [1] = {
105 .start = DMACH_I2S1_OUT,
106 .end = DMACH_I2S1_OUT,
107 .flags = IORESOURCE_DMA,
108 },
109 [2] = {
110 .start = DMACH_I2S1_IN,
111 .end = DMACH_I2S1_IN,
112 .flags = IORESOURCE_DMA,
113 },
114};
115
116struct s3c_audio_pdata s3c_i2s1_pdata = {
117 .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
49}; 118};
50 119
51struct platform_device s3c64xx_device_iis1 = { 120struct platform_device s3c64xx_device_iis1 = {
@@ -53,6 +122,9 @@ struct platform_device s3c64xx_device_iis1 = {
53 .id = 1, 122 .id = 1,
54 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource), 123 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
55 .resource = s3c64xx_iis1_resource, 124 .resource = s3c64xx_iis1_resource,
125 .dev = {
126 .platform_data = &s3c_i2s1_pdata,
127 },
56}; 128};
57EXPORT_SYMBOL(s3c64xx_device_iis1); 129EXPORT_SYMBOL(s3c64xx_device_iis1);
58 130
@@ -62,6 +134,20 @@ static struct resource s3c64xx_iisv4_resource[] = {
62 .end = S3C64XX_PA_IISV4 + 0x100 - 1, 134 .end = S3C64XX_PA_IISV4 + 0x100 - 1,
63 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
64 }, 136 },
137 [1] = {
138 .start = DMACH_HSI_I2SV40_TX,
139 .end = DMACH_HSI_I2SV40_TX,
140 .flags = IORESOURCE_DMA,
141 },
142 [2] = {
143 .start = DMACH_HSI_I2SV40_RX,
144 .end = DMACH_HSI_I2SV40_RX,
145 .flags = IORESOURCE_DMA,
146 },
147};
148
149struct s3c_audio_pdata s3c_i2sv4_pdata = {
150 .cfg_gpio = s3c64xx_i2sv4_cfg_gpio,
65}; 151};
66 152
67struct platform_device s3c64xx_device_iisv4 = { 153struct platform_device s3c64xx_device_iisv4 = {
@@ -69,6 +155,9 @@ struct platform_device s3c64xx_device_iisv4 = {
69 .id = -1, 155 .id = -1,
70 .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource), 156 .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource),
71 .resource = s3c64xx_iisv4_resource, 157 .resource = s3c64xx_iisv4_resource,
158 .dev = {
159 .platform_data = &s3c_i2sv4_pdata,
160 },
72}; 161};
73EXPORT_SYMBOL(s3c64xx_device_iisv4); 162EXPORT_SYMBOL(s3c64xx_device_iisv4);
74 163