aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/dev-audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx/dev-audio.c')
-rw-r--r--arch/arm/mach-s3c64xx/dev-audio.c64
1 files changed, 18 insertions, 46 deletions
diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index 9648fbc36eec..4a5c682a3727 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -22,44 +22,33 @@
22#include <plat/audio.h> 22#include <plat/audio.h>
23#include <plat/gpio-cfg.h> 23#include <plat/gpio-cfg.h>
24 24
25#include <mach/gpio-bank-c.h>
26#include <mach/gpio-bank-d.h>
27#include <mach/gpio-bank-e.h>
28#include <mach/gpio-bank-h.h>
29
30static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) 25static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
31{ 26{
27 unsigned int base;
28
32 switch (pdev->id) { 29 switch (pdev->id) {
33 case 0: 30 case 0:
34 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_I2S0_CLK); 31 base = S3C64XX_GPD(0);
35 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_I2S0_CDCLK);
36 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_I2S0_LRCLK);
37 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_I2S0_DI);
38 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_I2S0_D0);
39 break; 32 break;
40 case 1: 33 case 1:
41 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_I2S1_CLK); 34 base = S3C64XX_GPE(0);
42 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_I2S1_CDCLK); 35 break;
43 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_I2S1_LRCLK);
44 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_I2S1_DI);
45 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_I2S1_D0);
46 default: 36 default:
47 printk(KERN_DEBUG "Invalid I2S Controller number!"); 37 printk(KERN_DEBUG "Invalid I2S Controller number!");
48 return -EINVAL; 38 return -EINVAL;
49 } 39 }
50 40
41 s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3));
42
51 return 0; 43 return 0;
52} 44}
53 45
54static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev) 46static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
55{ 47{
56 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S_V40_DO0); 48 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
57 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S_V40_DO1); 49 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
58 s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S_V40_DO2); 50 s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
59 s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK); 51 s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
60 s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);
61 s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
62 s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
63 52
64 return 0; 53 return 0;
65} 54}
@@ -168,26 +157,21 @@ EXPORT_SYMBOL(s3c64xx_device_iisv4);
168 157
169static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) 158static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
170{ 159{
160 unsigned int base;
161
171 switch (pdev->id) { 162 switch (pdev->id) {
172 case 0: 163 case 0:
173 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK); 164 base = S3C64XX_GPD(0);
174 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK);
175 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC);
176 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN);
177 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT);
178 break; 165 break;
179 case 1: 166 case 1:
180 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK); 167 base = S3C64XX_GPE(0);
181 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK);
182 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC);
183 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN);
184 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT);
185 break; 168 break;
186 default: 169 default:
187 printk(KERN_DEBUG "Invalid PCM Controller number!"); 170 printk(KERN_DEBUG "Invalid PCM Controller number!");
188 return -EINVAL; 171 return -EINVAL;
189 } 172 }
190 173
174 s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(2));
191 return 0; 175 return 0;
192} 176}
193 177
@@ -261,24 +245,12 @@ EXPORT_SYMBOL(s3c64xx_device_pcm1);
261 245
262static int s3c64xx_ac97_cfg_gpd(struct platform_device *pdev) 246static int s3c64xx_ac97_cfg_gpd(struct platform_device *pdev)
263{ 247{
264 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_AC97_BITCLK); 248 return s3c_gpio_cfgpin_range(S3C64XX_GPD(0), 5, S3C_GPIO_SFN(4));
265 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_AC97_nRESET);
266 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_AC97_SYNC);
267 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_AC97_SDI);
268 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_AC97_SDO);
269
270 return 0;
271} 249}
272 250
273static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev) 251static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev)
274{ 252{
275 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_AC97_BITCLK); 253 return s3c_gpio_cfgpin_range(S3C64XX_GPE(0), 5, S3C_GPIO_SFN(4));
276 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_AC97_nRESET);
277 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_AC97_SYNC);
278 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_AC97_SDI);
279 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_AC97_SDO);
280
281 return 0;
282} 254}
283 255
284static struct resource s3c64xx_ac97_resource[] = { 256static struct resource s3c64xx_ac97_resource[] = {