From f5321760ce1d65fd69facc982b8523b19edf07a0 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 27 May 2010 14:57:27 +0900 Subject: ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions To aide in changing the gpio code, remove the use of pin-specific configs and move to using the S3C_GPIO_SFN() versions. Signed-off-by: Ben Dooks Signed-off-by: Kukjin Kim --- arch/arm/mach-s3c64xx/dev-audio.c | 79 ++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 42 deletions(-) (limited to 'arch/arm/mach-s3c64xx/dev-audio.c') diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index 9648fbc36eec..c9a44969e648 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -22,27 +22,22 @@ #include #include -#include -#include -#include -#include - static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) { switch (pdev->id) { case 0: - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_I2S0_CLK); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_I2S0_CDCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_I2S0_LRCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_I2S0_DI); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_I2S0_D0); + s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C_GPIO_SFN(3)); break; case 1: - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_I2S1_CLK); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_I2S1_CDCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_I2S1_LRCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_I2S1_DI); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_I2S1_D0); + s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C_GPIO_SFN(3)); + s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C_GPIO_SFN(3)); default: printk(KERN_DEBUG "Invalid I2S Controller number!"); return -EINVAL; @@ -53,13 +48,13 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev) { - s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S_V40_DO0); - s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S_V40_DO1); - s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S_V40_DO2); - s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK); - s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK); - s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK); - s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI); + s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5)); + s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5)); + s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5)); + s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C_GPIO_SFN(4)); return 0; } @@ -170,18 +165,18 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) { switch (pdev->id) { case 0: - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT); + s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C_GPIO_SFN(2)); break; case 1: - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT); + s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C_GPIO_SFN(2)); + s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C_GPIO_SFN(2)); break; default: printk(KERN_DEBUG "Invalid PCM Controller number!"); @@ -261,22 +256,22 @@ EXPORT_SYMBOL(s3c64xx_device_pcm1); static int s3c64xx_ac97_cfg_gpd(struct platform_device *pdev) { - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_AC97_BITCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_AC97_nRESET); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_AC97_SYNC); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_AC97_SDI); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_AC97_SDO); + s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C_GPIO_SFN(4)); return 0; } static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev) { - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_AC97_BITCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_AC97_nRESET); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_AC97_SYNC); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_AC97_SDI); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_AC97_SDO); + s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C_GPIO_SFN(4)); return 0; } -- cgit v1.2.1 From 2618b555d2734df3c8ca71df319d318489318083 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 27 May 2010 15:54:06 +0900 Subject: ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Change the code setting ranges of GPIO pins using s3c_gpio_cfgpin() to use the recently introduced s3c_gpio_cfgpin_range(). Signed-off-by: Ben Dooks Signed-off-by: Kukjin Kim --- arch/arm/mach-s3c64xx/dev-audio.c | 53 +++++++++++---------------------------- 1 file changed, 15 insertions(+), 38 deletions(-) (limited to 'arch/arm/mach-s3c64xx/dev-audio.c') diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index c9a44969e648..e4bb02395d9e 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -24,25 +24,22 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) { + unsigned int base; + switch (pdev->id) { case 0: - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C_GPIO_SFN(3)); + base = S3C64XX_GPD(0); break; case 1: - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C_GPIO_SFN(3)); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C_GPIO_SFN(3)); + base = S3C64XX_GPE(0); + break; default: printk(KERN_DEBUG "Invalid I2S Controller number!"); return -EINVAL; } + s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3)); + return 0; } @@ -51,10 +48,7 @@ static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev) s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5)); s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5)); s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5)); - s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(4)); return 0; } @@ -163,26 +157,21 @@ EXPORT_SYMBOL(s3c64xx_device_iisv4); static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) { + unsigned int base; + switch (pdev->id) { case 0: - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C_GPIO_SFN(2)); + base = S3C64XX_GPD(0); break; case 1: - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C_GPIO_SFN(2)); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C_GPIO_SFN(2)); + base = S3C64XX_GPE(0); break; default: printk(KERN_DEBUG "Invalid PCM Controller number!"); return -EINVAL; } + s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(2)); return 0; } @@ -256,24 +245,12 @@ EXPORT_SYMBOL(s3c64xx_device_pcm1); static int s3c64xx_ac97_cfg_gpd(struct platform_device *pdev) { - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C_GPIO_SFN(4)); - - return 0; + return s3c_gpio_cfgpin_range(S3C64XX_GPD(0), 5, S3C_GPIO_SFN(4)); } static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev) { - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C_GPIO_SFN(4)); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C_GPIO_SFN(4)); - - return 0; + return s3c_gpio_cfgpin_range(S3C64XX_GPE(0), 5, S3C_GPIO_SFN(4)); } static struct resource s3c64xx_ac97_resource[] = { -- cgit v1.2.1 From dff2126c548d54b040997257407a69a6cdf7a5b6 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 14 Oct 2010 07:53:12 +0900 Subject: ARM: S3C64XX: Fix special function for IISv4 port When converting to use s3c_gpio_cfgpin_range() the function for the IISv4 block appears to have been typoed as 4 (the keypad) rather than 5 as it should be. Signed-off-by: Mark Brown Signed-off-by: Kukjin Kim --- arch/arm/mach-s3c64xx/dev-audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c64xx/dev-audio.c') diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index e4bb02395d9e..4a5c682a3727 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -48,7 +48,7 @@ static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev) s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5)); s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5)); s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5)); - s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(4)); + s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5)); return 0; } -- cgit v1.2.1