linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* GPIO updates for -next
@ 2010-05-28  5:56 Ben Dooks
  2010-05-28  5:56 ` [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins Ben Dooks
                   ` (14 more replies)
  0 siblings, 15 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Some GPIO updates for -next, to add some helpers to do common
jobs in the kernel to reduce iimage and code size.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  9:53   ` Sergei Shtylyov
  2010-05-28  5:56 ` [PATCH 02/15] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions Ben Dooks
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Add s3c_gpio_cfgpin_range() to configure a range of pins to the given
value. This is useful for a number of blocks where the pins are in order
and saves multiple calls to s3c_gpio_cfgpin().

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/plat-samsung/gpio-config.c           |   15 +++++++++++++++
 arch/arm/plat-samsung/include/plat/gpio-cfg.h |   13 +++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index 57b68a5..a927dd2 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -41,6 +41,21 @@ int s3c_gpio_cfgpin(unsigned int pin, unsigned int config)
 }
 EXPORT_SYMBOL(s3c_gpio_cfgpin);
 
+int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
+			  unsigned int cfg)
+{
+	int ret;
+
+	for (; nr > 0; nr--, start++) {
+		ret = s3c_gpio_cfgpin(start, cfg);
+		if (ret != 0)
+			return ret;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(s3c_gpio_cfgpin_range);
+
 unsigned s3c_gpio_getcfg(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index 34efdd2..8ec9936 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -89,6 +89,19 @@ extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to);
  */
 extern unsigned s3c_gpio_getcfg(unsigned int pin);
 
+/**
+ * s3c_gpio_cfgpin_range() - Change the GPIO function for configuring pin range
+ * @start: The pin number to start at
+ * @number: The number of pins to configure from @start.
+ * @cfg: The configuration for the pin's function
+ *
+ * Call s3c_gpio_cfgpin() for the @number pins starting at @start.
+ *
+ * @sa s3c_gpio_cfgpin.
+ */
+extern int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
+				 unsigned int cfg);
+
 /* Define values for the pull-{up,down} available for each gpio pin.
  *
  * These values control the state of the weak pull-{up,down} resistors
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 02/15] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
  2010-05-28  5:56 ` [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 03/15] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Ben Dooks
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

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 <ben-linux@fluff.org>
---
 arch/arm/mach-s3c64xx/dev-audio.c |   79 +++++++++++++++++-------------------
 1 files changed, 37 insertions(+), 42 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index c3e9e73..6699cdc 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -22,27 +22,22 @@
 #include <plat/audio.h>
 #include <plat/gpio-cfg.h>
 
-#include <mach/gpio-bank-c.h>
-#include <mach/gpio-bank-d.h>
-#include <mach/gpio-bank-e.h>
-#include <mach/gpio-bank-h.h>
-
 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;
 }
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 03/15] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
  2010-05-28  5:56 ` [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins Ben Dooks
  2010-05-28  5:56 ` [PATCH 02/15] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 04/15] ARM: S5P6440: " Ben Dooks
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

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 <ben-linux@fluff.org>
---
 arch/arm/mach-s3c64xx/dev-audio.c        |   53 ++++++++---------------------
 arch/arm/mach-s3c64xx/setup-sdhci-gpio.c |    8 ++--
 2 files changed, 19 insertions(+), 42 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index 6699cdc..ca072c9 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[] = {
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
index a58c0cc..384fcda 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -28,8 +28,8 @@ void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 	end = S3C64XX_GPG(2 + width);
 
 	/* Set all the necessary GPG pins to special-function 0 */
+	s3c_gpio_cfgpin_range(S3C64XX_GPG(0), 2 + width, S3C_GPIO_SFN(2));
 	for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
@@ -45,8 +45,8 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 	end = S3C64XX_GPH(2 + width);
 
 	/* Set all the necessary GPG pins to special-function 0 */
+	s3c_gpio_cfgpin_range(S3C64XX_GPH(0), 2 + width, S3C_GPIO_SFN(2));
 	for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
@@ -62,14 +62,14 @@ void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 	end = S3C64XX_GPH(6 + width);
 
 	/* Set all the necessary GPH pins to special-function 1 */
+	s3c_gpio_cfgpin_range(S3C64XX_GPH(6), width, S3C_GPIO_SFN(3));
 	for (gpio = S3C64XX_GPH(6); gpio < end; gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
 	/* Set all the necessary GPC pins to special-function 1 */
+	s3c_gpio_cfgpin_range(S3C64XX_GPC(4), 2, S3C_GPIO_SFN(3));
 	for (gpio = S3C64XX_GPC(4); gpio < S3C64XX_GPC(6); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 }
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 04/15] ARM: S5P6440: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (2 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 03/15] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 05/15] ARM: S5P6442: " Ben Dooks
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

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 <ben-linux@fluff.org>
---
 arch/arm/mach-s5p6440/dev-audio.c |   16 ++++------------
 arch/arm/mach-s5p6440/dev-spi.c   |   12 ++++++------
 2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-s5p6440/dev-audio.c b/arch/arm/mach-s5p6440/dev-audio.c
index 0c53679..f929290 100644
--- a/arch/arm/mach-s5p6440/dev-audio.c
+++ b/arch/arm/mach-s5p6440/dev-audio.c
@@ -24,13 +24,8 @@ static int s5p6440_cfg_i2s(struct platform_device *pdev)
 	/* configure GPIO for i2s port */
 	switch (pdev->id) {
 	case -1:
-		s3c_gpio_cfgpin(S5P6440_GPR(4), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5P6440_GPR(5), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(5));
+		s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5));
+		s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5));
 		break;
 
 	default:
@@ -79,11 +74,8 @@ static int s5p6440_pcm_cfg_gpio(struct platform_device *pdev)
 {
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5P6440_GPR(6), 3, S3C_GPIO_SFN(2));
 		break;
 
 	default:
diff --git a/arch/arm/mach-s5p6440/dev-spi.c b/arch/arm/mach-s5p6440/dev-spi.c
index 0a30280..473eae4 100644
--- a/arch/arm/mach-s5p6440/dev-spi.c
+++ b/arch/arm/mach-s5p6440/dev-spi.c
@@ -35,20 +35,18 @@ static char *spi_src_clks[] = {
  */
 static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
 {
+	unsigned int base;
+
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5P6440_GPC(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPC(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPC(2), S3C_GPIO_SFN(2));
+		base = S5P6440_GPC(0);
 		s3c_gpio_setpull(S5P6440_GPC(0), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5P6440_GPC(1), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5P6440_GPC(2), S3C_GPIO_PULL_UP);
 		break;
 
 	case 1:
-		s3c_gpio_cfgpin(S5P6440_GPC(4), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPC(5), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6440_GPC(6), S3C_GPIO_SFN(2));
+		base = S5P6440_GPC(4);
 		s3c_gpio_setpull(S5P6440_GPC(4), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5P6440_GPC(5), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5P6440_GPC(6), S3C_GPIO_PULL_UP);
@@ -59,6 +57,8 @@ static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
+
 	return 0;
 }
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 05/15] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (3 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 04/15] ARM: S5P6440: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  6:24   ` Kyungmin Park
  2010-05-28  5:56 ` [PATCH 06/15] ARM: S5PC100: " Ben Dooks
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

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 <ben-linux@fluff.org>
---
 arch/arm/mach-s5p6442/dev-audio.c |   30 ++++++++++--------------------
 arch/arm/mach-s5p6442/dev-spi.c   |    4 +---
 2 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-s5p6442/dev-audio.c b/arch/arm/mach-s5p6442/dev-audio.c
index cb801e1..0e57caf 100644
--- a/arch/arm/mach-s5p6442/dev-audio.c
+++ b/arch/arm/mach-s5p6442/dev-audio.c
@@ -21,22 +21,16 @@
 
 static int s5p6442_cfg_i2s(struct platform_device *pdev)
 {
+	unsigned int base;
+
 	/* configure GPIO for i2s port */
 	switch (pdev->id) {
 	case 1:
-		s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(2));
+		base = S5P6442_GPC1(0);
 		break;
 
 	case -1:
-		s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(2));
+		base = S5P6442_GPC0(0);
 		break;
 
 	default:
@@ -44,6 +38,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(2));
 	return 0;
 }
 
@@ -111,21 +106,15 @@ struct platform_device s5p6442_device_iis1 = {
 
 static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
 {
+	unsigned int base;
+
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(3));
+		base = S5P6442_GPC0(0);
 		break;
 
 	case 1:
-		s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(3));
+		base = S5P6442_GPC1(0);
 		break;
 
 	default:
@@ -133,6 +122,7 @@ static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3));
 	return 0;
 }
 
diff --git a/arch/arm/mach-s5p6442/dev-spi.c b/arch/arm/mach-s5p6442/dev-spi.c
index 3019952..1c5c170 100644
--- a/arch/arm/mach-s5p6442/dev-spi.c
+++ b/arch/arm/mach-s5p6442/dev-spi.c
@@ -37,9 +37,7 @@ static int s5p6442_spi_cfg_gpio(struct platform_device *pdev)
 {
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5P6442_GPB(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPB(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5P6442_GPB(3), S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5P6442_GPB(0), 4, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(S5P6442_GPB(0), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5P6442_GPB(2), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5P6442_GPB(3), S3C_GPIO_PULL_UP);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 06/15] ARM: S5PC100: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (4 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 05/15] ARM: S5P6442: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 07/15] ARM: S5PV210: " Ben Dooks
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

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 <ben-linux@fluff.org>
---
 arch/arm/mach-s5pc100/dev-audio.c        |   32 ++++-------------------------
 arch/arm/mach-s5pc100/dev-spi.c          |   17 +++++++--------
 arch/arm/mach-s5pc100/setup-sdhci-gpio.c |    6 ++--
 3 files changed, 16 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c
index 18cfe9a..078b938 100644
--- a/arch/arm/mach-s5pc100/dev-audio.c
+++ b/arch/arm/mach-s5pc100/dev-audio.c
@@ -24,19 +24,11 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev)
 	/* configure GPIO for i2s port */
 	switch (pdev->id) {
 	case 1:
-		s3c_gpio_cfgpin(S5PC100_GPC(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPC(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPC(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPC(3), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPC(4), S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5PC100_GPC(0), 5, S3C_GPIO_SFN(2));
 		break;
 
 	case 2:
-		s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PC100_GPG3(1), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PC100_GPG3(2), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PC100_GPG3(3), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PC100_GPG3(4), S3C_GPIO_SFN(4));
+		s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 5, S3C_GPIO_SFN(4));
 		break;
 
 	case -1: /* Dedicated pins */
@@ -144,19 +136,11 @@ static int s5pc100_pcm_cfg_gpio(struct platform_device *pdev)
 {
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5PC100_GPG3(1), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5PC100_GPG3(2), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5PC100_GPG3(3), S3C_GPIO_SFN(5));
-		s3c_gpio_cfgpin(S5PC100_GPG3(4), S3C_GPIO_SFN(5));
+		s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 5, S3C_GPIO_SFN(5));
 		break;
 
 	case 1:
-		s3c_gpio_cfgpin(S5PC100_GPC(0), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PC100_GPC(1), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PC100_GPC(2), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PC100_GPC(3), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PC100_GPC(4), S3C_GPIO_SFN(3));
+		s3c_gpio_cfgpin_range(S5PC100_GPC(0), 5, S3C_GPIO_SFN(3));
 		break;
 
 	default:
@@ -231,13 +215,7 @@ struct platform_device s5pc100_device_pcm1 = {
 
 static int s5pc100_ac97_cfg_gpio(struct platform_device *pdev)
 {
-	s3c_gpio_cfgpin(S5PC100_GPC(0), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PC100_GPC(1), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PC100_GPC(2), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PC100_GPC(3), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PC100_GPC(4), S3C_GPIO_SFN(4));
-
-	return 0;
+	return s3c_gpio_cfgpin_range(S5PC100_GPC(0), 5, S3C_GPIO_SFN(4));
 }
 
 static struct resource s5pc100_ac97_resource[] = {
diff --git a/arch/arm/mach-s5pc100/dev-spi.c b/arch/arm/mach-s5pc100/dev-spi.c
index 14618c3..e04c431 100644
--- a/arch/arm/mach-s5pc100/dev-spi.c
+++ b/arch/arm/mach-s5pc100/dev-spi.c
@@ -36,29 +36,25 @@ static char *spi_src_clks[] = {
  */
 static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
 {
+	unsigned int base, type;
+
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5PC100_GPB(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPB(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPB(2), S3C_GPIO_SFN(2));
+		base = S5PC100_GPB(0);
 		s3c_gpio_setpull(S5PC100_GPB(0), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5PC100_GPB(1), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5PC100_GPB(2), S3C_GPIO_PULL_UP);
 		break;
 
 	case 1:
-		s3c_gpio_cfgpin(S5PC100_GPB(4), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPB(5), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PC100_GPB(6), S3C_GPIO_SFN(2));
+		base = S5PC100_GPB(4);
 		s3c_gpio_setpull(S5PC100_GPB(4), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5PC100_GPB(5), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5PC100_GPB(6), S3C_GPIO_PULL_UP);
 		break;
 
 	case 2:
-		s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PC100_GPG3(2), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PC100_GPG3(3), S3C_GPIO_SFN(3));
+		base = S5PC100_GPG3(0);
 		s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5PC100_GPG3(2), S3C_GPIO_PULL_UP);
 		s3c_gpio_setpull(S5PC100_GPG3(3), S3C_GPIO_PULL_UP);
@@ -69,6 +65,9 @@ static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	type = (pdev->id == 2) ? S3C_GPIO_SFN(3) : S3C_GPIO_SFN(2);
+	s3c_gpio_cfgpin_range(base, 3, type);
+
 	return 0;
 }
 
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 7769c76..320dc64 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -35,8 +35,8 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 	end = S5PC100_GPG0(2 + num);
 
 	/* Set all the necessary GPG0/GPG1 pins to special-function 0 */
+	s3c_gpio_cfgpin_range(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2));
 	for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
@@ -57,10 +57,10 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 	unsigned int end;
 
 	end = S5PC100_GPG2(2 + width);
+	s3c_gpio_cfgpin_range(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));
 
 	/* Set all the necessary GPG2 pins to special-function 2 */
 	for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
@@ -74,10 +74,10 @@ void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 	unsigned int end;
 
 	end = S5PC100_GPG3(2 + width);
+	s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));
 
 	/* Set all the necessary GPG3 pins to special-function 2 */
 	for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 07/15] ARM: S5PV210: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (5 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 06/15] ARM: S5PC100: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 08/15] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Ben Dooks
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

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 <ben-linux@fluff.org>
---
 arch/arm/mach-s5pv210/dev-audio.c        |   46 ++++-------------------------
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c |   16 +++++-----
 2 files changed, 15 insertions(+), 47 deletions(-)

diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
index 6e21533..5c67829 100644
--- a/arch/arm/mach-s5pv210/dev-audio.c
+++ b/arch/arm/mach-s5pv210/dev-audio.c
@@ -24,29 +24,15 @@ static int s5pv210_cfg_i2s(struct platform_device *pdev)
 	/* configure GPIO for i2s port */
 	switch (pdev->id) {
 	case 1:
-		s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2));
 		break;
 
 	case 2:
-		s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PV210_GPC1(1), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PV210_GPC1(2), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PV210_GPC1(3), S3C_GPIO_SFN(4));
-		s3c_gpio_cfgpin(S5PV210_GPC1(4), S3C_GPIO_SFN(4));
+		s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4));
 		break;
 
 	case -1:
-		s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPI(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPI(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPI(3), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPI(4), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPI(5), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPI(6), S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2));
 		break;
 
 	default:
@@ -151,25 +137,13 @@ static int s5pv210_pcm_cfg_gpio(struct platform_device *pdev)
 {
 	switch (pdev->id) {
 	case 0:
-		s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPI(1), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPI(2), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPI(3), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPI(4), S3C_GPIO_SFN(3));
+		s3c_gpio_cfgpin_range(S5PV210_GPI(0), 5, S3C_GPIO_SFN(3));
 		break;
 	case 1:
-		s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(3));
-		s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(3));
+		s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(3));
 		break;
 	case 2:
-		s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC1(1), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC1(2), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC1(3), S3C_GPIO_SFN(2));
-		s3c_gpio_cfgpin(S5PV210_GPC1(4), S3C_GPIO_SFN(2));
+		s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(2));
 		break;
 	default:
 		printk(KERN_DEBUG "Invalid PCM Controller number!");
@@ -271,13 +245,7 @@ struct platform_device s5pv210_device_pcm2 = {
 
 static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev)
 {
-	s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(4));
-	s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(4));
-
-	return 0;
+	return s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(4));
 }
 
 static struct resource s5pv210_ac97_resource[] = {
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index fe7d86d..147abd0 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -27,21 +27,21 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 	unsigned int gpio;
 
 	/* Set all the necessary GPG0/GPG1 pins to special-function 2 */
+	s3c_gpio_cfgpin_range(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2));
 	for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 	switch (width) {
 	case 8:
 		/* GPG1[3:6] special-funtion 3 */
+		s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3));
 		for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
-			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
 			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 		}
 	case 4:
 		/* GPG0[3:6] special-funtion 2 */
+		s3c_gpio_cfgpin_range(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2));
 		for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) {
-			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 		}
 	default:
@@ -57,14 +57,14 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 	unsigned int gpio;
 
 	/* Set all the necessary GPG1[0:1] pins to special-function 2 */
+	s3c_gpio_cfgpin_range(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2));
 	for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
 	/* Data pin GPG1[3:6] to special-function 2 */
+	s3c_gpio_cfgpin(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2));
 	for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
@@ -77,22 +77,22 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 	unsigned int gpio;
 
 	/* Set all the necessary GPG2[0:1] pins to special-function 2 */
+	s3c_gpio_cfgpin_range(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2));
 	for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 	}
 
 	switch (width) {
 	case 8:
 		/* Data pin GPG3[3:6] to special-function 3 */
+		s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3));
 		for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {
-			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
 			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 		}
 	case 4:
 		/* Data pin GPG2[3:6] to special-function 2 */
+		s3c_gpio_cfgpin_range(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2));
 		for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) {
-			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
 			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
 		}
 	default:
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 08/15] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (6 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 07/15] ARM: S5PV210: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  9:56   ` Sergei Shtylyov
  2010-05-28  5:56 ` [PATCH 09/15] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range() Ben Dooks
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Add a function to configure a range of GPIOs function and
pull in one go, mainly for the SDHCI and framebuffer helpers
which tend to do this.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/plat-samsung/gpio-config.c           |   15 +++++++++++++++
 arch/arm/plat-samsung/include/plat/gpio-cfg.h |   20 ++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index a927dd2..3a02e23 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -56,6 +56,21 @@ int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
 }
 EXPORT_SYMBOL_GPL(s3c_gpio_cfgpin_range);
 
+int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr,
+			  unsigned int cfg, s3c_gpio_pull_t pull)
+{
+	int ret;
+
+	for (; nr > 0; nr--, start++) {
+		s3c_gpio_setpull(start, pull);
+		ret = s3c_gpio_cfgpin(start, cfg);
+		if (ret != 0)
+			return ret;
+	}
+
+}
+EXPORT_SYMBOL_GPL(s3c_gpio_cfgall_range);
+
 unsigned s3c_gpio_getcfg(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index 8ec9936..bec872f 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -161,4 +161,24 @@ extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin);
 */
 extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr);
 
+/* configure `all` aspects of an gpio */
+
+/**
+ * s3c_gpio_cfgall_range() - configure range of gpio functtion and pull.
+ * @gpio: The gpio number to start at.
+ * @size: The number of gpio to configure.
+ * @cfg: The configuration to use
+ * @pull: The pull setting to use.
+ *
+ * Run s3c_gpio_cfgpin() and s3c_gpio_setpull() over the gpio range starting
+ * @gpio and running for @size.
+ *
+ * @sa s3c_gpio_cfgpin
+ * @sa s3c_gpio_setpull
+ * @sa s3c_gpio_cfgpin_range
+ */
+extern int s3c_gpio_cfgall_range(unsigned int pin, unsigned int size,
+				 unsigned int cfg, s3c_gpio_pull_t pull);
+
+
 #endif /* __PLAT_GPIO_CFG_H */
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 09/15] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (7 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 08/15] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 10/15] ARM: S5PC100: " Ben Dooks
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().

Mop up a few missed s3c_gpio_cfgpin_range() changes.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/mach-s3c64xx/setup-fb-24bpp.c   |   14 +++-------
 arch/arm/mach-s3c64xx/setup-sdhci-gpio.c |   39 ++++++-----------------------
 2 files changed, 12 insertions(+), 41 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
index 8e28e44..b3ac75f 100644
--- a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
+++ b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
@@ -23,15 +23,9 @@
 
 extern void s3c64xx_fb_gpio_setup_24bpp(void)
 {
-	unsigned int gpio;
+	s3c_gpio_cfgall_range(S3C64XX_GPI(0), 16,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
-	for (gpio = S3C64XX_GPI(0); gpio <= S3C64XX_GPI(15); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
-
-	for (gpio = S3C64XX_GPJ(0); gpio <= S3C64XX_GPJ(11); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S3C64XX_GPJ(0), 12,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 }
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
index 384fcda..45640ef 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -22,16 +22,9 @@
 
 void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-	unsigned int end;
-
-	end = S3C64XX_GPG(2 + width);
-
 	/* Set all the necessary GPG pins to special-function 0 */
-	s3c_gpio_cfgpin_range(S3C64XX_GPG(0), 2 + width, S3C_GPIO_SFN(2));
-	for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S3C64XX_GPG(0), 2 + width,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2));
@@ -39,16 +32,9 @@ void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 
 void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-	unsigned int end;
-
-	end = S3C64XX_GPH(2 + width);
-
 	/* Set all the necessary GPG pins to special-function 0 */
-	s3c_gpio_cfgpin_range(S3C64XX_GPH(0), 2 + width, S3C_GPIO_SFN(2));
-	for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S3C64XX_GPH(0), 2 + width,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
@@ -56,20 +42,11 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 
 void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-	unsigned int end;
-
-	end = S3C64XX_GPH(6 + width);
-
 	/* Set all the necessary GPH pins to special-function 1 */
-	s3c_gpio_cfgpin_range(S3C64XX_GPH(6), width, S3C_GPIO_SFN(3));
-	for (gpio = S3C64XX_GPH(6); gpio < end; gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S3C64XX_GPH(6), width,
+			      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
 
 	/* Set all the necessary GPC pins to special-function 1 */
-	s3c_gpio_cfgpin_range(S3C64XX_GPC(4), 2, S3C_GPIO_SFN(3));
-	for (gpio = S3C64XX_GPC(4); gpio < S3C64XX_GPC(6); gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S3C64XX_GPC(4), 2,
+			      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
 }
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 10/15] ARM: S5PC100: Change to using s3c_gpio_cfgall_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (8 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 09/15] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range() Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 11/15] ARM: S5PV210: " Ben Dooks
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().

Mop up a few missed s3c_gpio_cfgpin_range() changes.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/mach-s5pc100/setup-fb-24bpp.c   |   30 +++++++----------------
 arch/arm/mach-s5pc100/setup-sdhci-gpio.c |   38 ++++++-----------------------
 2 files changed, 17 insertions(+), 51 deletions(-)

diff --git a/arch/arm/mach-s5pc100/setup-fb-24bpp.c b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
index 6eba6cb..5a882d4 100644
--- a/arch/arm/mach-s5pc100/setup-fb-24bpp.c
+++ b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
@@ -22,27 +22,15 @@
 
 #define DISR_OFFSET	0x7008
 
-void s5pc100_fb_gpio_setup_24bpp(void)
+static void s5pc100_fb_setgpios(unsigned int base, unsigned int nr)
 {
-	unsigned int gpio = 0;
-
-	for (gpio = S5PC100_GPF0(0); gpio <= S5PC100_GPF0(7); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
-
-	for (gpio = S5PC100_GPF1(0); gpio <= S5PC100_GPF1(7); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
-
-	for (gpio = S5PC100_GPF2(0); gpio <= S5PC100_GPF2(7); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+}
 
-	for (gpio = S5PC100_GPF3(0); gpio <= S5PC100_GPF3(3); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+void s5pc100_fb_gpio_setup_24bpp(void)
+{
+	s5pc100_fb_setgpios(S5PC100_GPF0(0), 8);
+	s5pc100_fb_setgpios(S5PC100_GPF1(0), 8);
+	s5pc100_fb_setgpios(S5PC100_GPF2(0), 8);
+	s5pc100_fb_setgpios(S5PC100_GPF3(0), 4);
 }
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 320dc64..15cf1ac 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -23,8 +23,6 @@
 
 void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-	unsigned int end;
 	unsigned int num;
 
 	num = width;
@@ -32,19 +30,13 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 	if (width == 8)
 		num = width - 2;
 
-	end = S5PC100_GPG0(2 + num);
-
 	/* Set all the necessary GPG0/GPG1 pins to special-function 0 */
-	s3c_gpio_cfgpin_range(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2));
-	for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PC100_GPG0(0), 2 + num,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	if (width == 8) {
-		for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) {
-			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		}
+		s3c_gpio_cfgall_range(S5PC100_GPG1(0), 2,
+				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 	}
 
 	s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
@@ -53,16 +45,9 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 
 void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-	unsigned int end;
-
-	end = S5PC100_GPG2(2 + width);
-	s3c_gpio_cfgpin_range(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));
-
 	/* Set all the necessary GPG2 pins to special-function 2 */
-	for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PC100_GPG2(0), 2 + width,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
@@ -70,16 +55,9 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 
 void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-	unsigned int end;
-
-	end = S5PC100_GPG3(2 + width);
-	s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));
-
 	/* Set all the necessary GPG3 pins to special-function 2 */
-	for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PC100_GPG3(0), 2 + width,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 11/15] ARM: S5PV210: Change to using s3c_gpio_cfgall_range()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (9 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 10/15] ARM: S5PC100: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 12/15] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper Ben Dooks
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().

Mop up a few missed s3c_gpio_cfgpin_range() changes.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/mach-s5pv210/setup-fb-24bpp.c   |   32 +++++------------
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c |   55 +++++++++--------------------
 2 files changed, 27 insertions(+), 60 deletions(-)

diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
index a50cbac..ac07542 100644
--- a/arch/arm/mach-s5pv210/setup-fb-24bpp.c
+++ b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
@@ -21,33 +21,21 @@
 #include <mach/regs-clock.h>
 #include <plat/gpio-cfg.h>
 
-void s5pv210_fb_gpio_setup_24bpp(void)
+static void s5pv210_fb_cfg_gpios(unsigned int base, unsigned int nr)
 {
-	unsigned int gpio = 0;
-
-	for (gpio = S5PV210_GPF0(0); gpio <= S5PV210_GPF0(7); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
-	}
+	s3c_gpio_cfgall_range(base, size, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
-	for (gpio = S5PV210_GPF1(0); gpio <= S5PV210_GPF1(7); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	for (; nr > 0; nr--, base++)
 		s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
-	}
+}
 
-	for (gpio = S5PV210_GPF2(0); gpio <= S5PV210_GPF2(7); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
-	}
 
-	for (gpio = S5PV210_GPF3(0); gpio <= S5PV210_GPF3(3); gpio++) {
-		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
-	}
+void s5pv210_fb_gpio_setup_24bpp(void)
+{
+	s5pv210_fb_cfg_gpios(S5PV210_GPF0(0), 8);
+	s5pv210_fb_cfg_gpios(S5PV210_GPF1(0), 8);
+	s5pv210_fb_cfg_gpios(S5PV210_GPF2(0), 8);
+	s5pv210_fb_cfg_gpios(S5PV210_GPF3(0), 4);
 
 	/* Set DISPLAY_CONTROL register for Display path selection.
 	 *
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index 147abd0..38189d1 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -24,26 +24,19 @@
 
 void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-
 	/* Set all the necessary GPG0/GPG1 pins to special-function 2 */
-	s3c_gpio_cfgpin_range(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2));
-	for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PV210_GPG0(0), 2,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+
 	switch (width) {
 	case 8:
 		/* GPG1[3:6] special-funtion 3 */
-		s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3));
-		for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
-			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		}
+		s3c_gpio_cfgall_range(S5PV210_GPG1(3), 4,
+				      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
 	case 4:
 		/* GPG0[3:6] special-funtion 2 */
-		s3c_gpio_cfgpin_range(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2));
-		for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) {
-			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		}
+		s3c_gpio_cfgall_range(S5PV210_GPG0(3), 4,
+				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 	default:
 		break;
 	}
@@ -54,19 +47,13 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 
 void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-
 	/* Set all the necessary GPG1[0:1] pins to special-function 2 */
-	s3c_gpio_cfgpin_range(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2));
-	for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PV210_GPG1(0), 2,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	/* Data pin GPG1[3:6] to special-function 2 */
-	s3c_gpio_cfgpin(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2));
-	for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PV210_GPG1(3), 4,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2));
@@ -74,27 +61,19 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 
 void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 {
-	unsigned int gpio;
-
 	/* Set all the necessary GPG2[0:1] pins to special-function 2 */
-	s3c_gpio_cfgpin_range(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2));
-	for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) {
-		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-	}
+	s3c_gpio_cfgall_range(S5PV210_GPG2(0), 2,
+			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 
 	switch (width) {
 	case 8:
 		/* Data pin GPG3[3:6] to special-function 3 */
-		s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3));
-		for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {
-			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		}
+		s3c_gpio_cfgall_range(S5PV210_GPG3(3), 4,
+				      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
 	case 4:
 		/* Data pin GPG2[3:6] to special-function 2 */
-		s3c_gpio_cfgpin_range(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2));
-		for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) {
-			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
-		}
+		s3c_gpio_cfgall_range(S5PV210_GPG2(3), 4,
+				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
 	default:
 		break;
 	}
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 12/15] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (10 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 11/15] ARM: S5PV210: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 13/15] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull() Ben Dooks
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

A number of the SDHCI code configure a GPIO to a special function
and remove any pull-up, so add s3c_gpio_cfgrange_nopull() as a
wrapper to the s3c_gpio_cfgall_range() to make the code that
calls it fit on one line.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/plat-samsung/include/plat/gpio-cfg.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index bec872f..47126c0 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -181,4 +181,10 @@ extern int s3c_gpio_cfgall_range(unsigned int pin, unsigned int size,
 				 unsigned int cfg, s3c_gpio_pull_t pull);
 
 
+static inline int s3c_gpio_cfgrange_nopull(unsigned int pin, unsigned int size,
+					   unsigned int cfg)
+{
+	return s3c_gpio_cfgall_range(pin, size, cfg, S3C_GPIO_PULL_NONE);
+}
+
 #endif /* __PLAT_GPIO_CFG_H */
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 13/15] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (11 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 12/15] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 14/15] ARM: S5PC100: " Ben Dooks
  2010-05-28  5:56 ` [PATCH 15/15] ARM: S5PV210: " Ben Dooks
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Chane code setting special-function and no pull-up to use
the s3c_gpio_cfgrange_nopull() wrapper.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/mach-s3c64xx/setup-sdhci-gpio.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
index 45640ef..9c2b118 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -23,8 +23,7 @@
 void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPG pins to special-function 0 */
-	s3c_gpio_cfgall_range(S3C64XX_GPG(0), 2 + width,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S3C64XX_GPG(0), 2 + width, S3C_GPIO_SFN(2));
 
 	s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2));
@@ -33,8 +32,7 @@ void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPG pins to special-function 0 */
-	s3c_gpio_cfgall_range(S3C64XX_GPH(0), 2 + width,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S3C64XX_GPH(0), 2 + width, S3C_GPIO_SFN(2));
 
 	s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
@@ -43,10 +41,8 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPH pins to special-function 1 */
-	s3c_gpio_cfgall_range(S3C64XX_GPH(6), width,
-			      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S3C64XX_GPH(6), width, S3C_GPIO_SFN(3));
 
 	/* Set all the necessary GPC pins to special-function 1 */
-	s3c_gpio_cfgall_range(S3C64XX_GPC(4), 2,
-			      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S3C64XX_GPC(4), 2, S3C_GPIO_SFN(3));
 }
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 14/15] ARM: S5PC100: Change to using s3c_gpio_cfgrange_nopull()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (12 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 13/15] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull() Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  2010-05-28  5:56 ` [PATCH 15/15] ARM: S5PV210: " Ben Dooks
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Chane code setting special-function and no pull-up to use
the s3c_gpio_cfgrange_nopull() wrapper.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/mach-s5pc100/setup-sdhci-gpio.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 15cf1ac..b353441 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -31,13 +31,10 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 		num = width - 2;
 
 	/* Set all the necessary GPG0/GPG1 pins to special-function 0 */
-	s3c_gpio_cfgall_range(S5PC100_GPG0(0), 2 + num,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2));
 
-	if (width == 8) {
-		s3c_gpio_cfgall_range(S5PC100_GPG1(0), 2,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
-	}
+	if (width == 8)
+		s3c_gpio_cfgrange_nopull(S5PC100_GPG1(0), 2, S3C_GPIO_SFN(2));
 
 	s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
@@ -46,8 +43,7 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPG2 pins to special-function 2 */
-	s3c_gpio_cfgall_range(S5PC100_GPG2(0), 2 + width,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));
 
 	s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
@@ -56,8 +52,7 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPG3 pins to special-function 2 */
-	s3c_gpio_cfgall_range(S5PC100_GPG3(0), 2 + width,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));
 
 	s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 15/15] ARM: S5PV210: Change to using s3c_gpio_cfgrange_nopull()
  2010-05-28  5:56 GPIO updates for -next Ben Dooks
                   ` (13 preceding siblings ...)
  2010-05-28  5:56 ` [PATCH 14/15] ARM: S5PC100: " Ben Dooks
@ 2010-05-28  5:56 ` Ben Dooks
  14 siblings, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Chane code setting special-function and no pull-up to use
the s3c_gpio_cfgrange_nopull() wrapper.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index 38189d1..2307d52 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -31,12 +31,10 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 	switch (width) {
 	case 8:
 		/* GPG1[3:6] special-funtion 3 */
-		s3c_gpio_cfgall_range(S5PV210_GPG1(3), 4,
-				      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+		s3c_gpio_cfgrange_nopull(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3));
 	case 4:
 		/* GPG0[3:6] special-funtion 2 */
-		s3c_gpio_cfgall_range(S5PV210_GPG0(3), 4,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+		s3c_gpio_cfgrange_nopull(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2));
 	default:
 		break;
 	}
@@ -48,12 +46,10 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPG1[0:1] pins to special-function 2 */
-	s3c_gpio_cfgall_range(S5PV210_GPG1(0), 2,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2));
 
 	/* Data pin GPG1[3:6] to special-function 2 */
-	s3c_gpio_cfgall_range(S5PV210_GPG1(3), 4,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2));
 
 	s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
 	s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2));
@@ -62,18 +58,15 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 {
 	/* Set all the necessary GPG2[0:1] pins to special-function 2 */
-	s3c_gpio_cfgall_range(S5PV210_GPG2(0), 2,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+	s3c_gpio_cfgrange_nopull(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2));
 
 	switch (width) {
 	case 8:
 		/* Data pin GPG3[3:6] to special-function 3 */
-		s3c_gpio_cfgall_range(S5PV210_GPG3(3), 4,
-				      S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+		s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3));
 	case 4:
 		/* Data pin GPG2[3:6] to special-function 2 */
-		s3c_gpio_cfgall_range(S5PV210_GPG2(3), 4,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+		s3c_gpio_cfgrange_nopull(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2));
 	default:
 		break;
 	}
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 05/15] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  5:56 ` [PATCH 05/15] ARM: S5P6442: " Ben Dooks
@ 2010-05-28  6:24   ` Kyungmin Park
  2010-05-28  6:35     ` Ben Dooks
  2010-05-31  1:09     ` Ben Dooks
  0 siblings, 2 replies; 22+ messages in thread
From: Kyungmin Park @ 2010-05-28  6:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Looks good but I'm afraid it's more difficult to find pin
configuration from typo.

On Fri, May 28, 2010 at 2:56 PM, Ben Dooks <ben-linux@fluff.org> wrote:
> 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 <ben-linux@fluff.org>
> ---
> ?arch/arm/mach-s5p6442/dev-audio.c | ? 30 ++++++++++--------------------
> ?arch/arm/mach-s5p6442/dev-spi.c ? | ? ?4 +---
> ?2 files changed, 11 insertions(+), 23 deletions(-)
>
> diff --git a/arch/arm/mach-s5p6442/dev-audio.c b/arch/arm/mach-s5p6442/dev-audio.c
> index cb801e1..0e57caf 100644
> --- a/arch/arm/mach-s5p6442/dev-audio.c
> +++ b/arch/arm/mach-s5p6442/dev-audio.c
> @@ -21,22 +21,16 @@
>
> ?static int s5p6442_cfg_i2s(struct platform_device *pdev)
> ?{
> + ? ? ? unsigned int base;
> +
> ? ? ? ?/* configure GPIO for i2s port */
> ? ? ? ?switch (pdev->id) {
> ? ? ? ?case 1:
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(2));
> + ? ? ? ? ? ? ? base = S5P6442_GPC1(0);
> ? ? ? ? ? ? ? ?break;
>
> ? ? ? ?case -1:
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(2));
> + ? ? ? ? ? ? ? base = S5P6442_GPC0(0);
> ? ? ? ? ? ? ? ?break;
>
> ? ? ? ?default:
> @@ -44,6 +38,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
> ? ? ? ? ? ? ? ?return -EINVAL;
> ? ? ? ?}
>
> + ? ? ? s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(2));
> ? ? ? ?return 0;
> ?}
>
> @@ -111,21 +106,15 @@ struct platform_device s5p6442_device_iis1 = {
>
> ?static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
> ?{
> + ? ? ? unsigned int base;
> +
> ? ? ? ?switch (pdev->id) {
> ? ? ? ?case 0:
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(3));
> + ? ? ? ? ? ? ? base = S5P6442_GPC0(0);
> ? ? ? ? ? ? ? ?break;
>
> ? ? ? ?case 1:
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(3));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(3));
> + ? ? ? ? ? ? ? base = S5P6442_GPC1(0);
> ? ? ? ? ? ? ? ?break;
>
> ? ? ? ?default:
> @@ -133,6 +122,7 @@ static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
> ? ? ? ? ? ? ? ?return -EINVAL;
> ? ? ? ?}
>
> + ? ? ? s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3));
> ? ? ? ?return 0;
> ?}
>
> diff --git a/arch/arm/mach-s5p6442/dev-spi.c b/arch/arm/mach-s5p6442/dev-spi.c
> index 3019952..1c5c170 100644
> --- a/arch/arm/mach-s5p6442/dev-spi.c
> +++ b/arch/arm/mach-s5p6442/dev-spi.c
> @@ -37,9 +37,7 @@ static int s5p6442_spi_cfg_gpio(struct platform_device *pdev)
> ?{
> ? ? ? ?switch (pdev->id) {
> ? ? ? ?case 0:
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPB(0), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPB(2), S3C_GPIO_SFN(2));
> - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPB(3), S3C_GPIO_SFN(2));
> + ? ? ? ? ? ? ? s3c_gpio_cfgpin_range(S5P6442_GPB(0), 4, S3C_GPIO_SFN(2));

Where's the GPB(1)???

Thank you,
Kyungmin Park

> ? ? ? ? ? ? ? ?s3c_gpio_setpull(S5P6442_GPB(0), S3C_GPIO_PULL_UP);
> ? ? ? ? ? ? ? ?s3c_gpio_setpull(S5P6442_GPB(2), S3C_GPIO_PULL_UP);
> ? ? ? ? ? ? ? ?s3c_gpio_setpull(S5P6442_GPB(3), S3C_GPIO_PULL_UP);
> --
> 1.6.3.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 05/15] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  6:24   ` Kyungmin Park
@ 2010-05-28  6:35     ` Ben Dooks
  2010-05-31  1:09     ` Ben Dooks
  1 sibling, 0 replies; 22+ messages in thread
From: Ben Dooks @ 2010-05-28  6:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 28, 2010 at 03:24:02PM +0900, Kyungmin Park wrote:
> Hi,
> 
> Looks good but I'm afraid it's more difficult to find pin
> configuration from typo.

I'm not sure if that's really so much of a problem.
 
> On Fri, May 28, 2010 at 2:56 PM, Ben Dooks <ben-linux@fluff.org> wrote:
> > 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 <ben-linux@fluff.org>
> > ---
> > ?arch/arm/mach-s5p6442/dev-audio.c | ? 30 ++++++++++--------------------
> > ?arch/arm/mach-s5p6442/dev-spi.c ? | ? ?4 +---
> > ?2 files changed, 11 insertions(+), 23 deletions(-)
> >
> > diff --git a/arch/arm/mach-s5p6442/dev-audio.c b/arch/arm/mach-s5p6442/dev-audio.c
> > index cb801e1..0e57caf 100644
> > --- a/arch/arm/mach-s5p6442/dev-audio.c
> > +++ b/arch/arm/mach-s5p6442/dev-audio.c
> > @@ -21,22 +21,16 @@
> >
> > ?static int s5p6442_cfg_i2s(struct platform_device *pdev)
> > ?{
> > + ? ? ? unsigned int base;
> > +
> > ? ? ? ?/* configure GPIO for i2s port */
> > ? ? ? ?switch (pdev->id) {
> > ? ? ? ?case 1:
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(2));
> > + ? ? ? ? ? ? ? base = S5P6442_GPC1(0);
> > ? ? ? ? ? ? ? ?break;
> >
> > ? ? ? ?case -1:
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(2));
> > + ? ? ? ? ? ? ? base = S5P6442_GPC0(0);
> > ? ? ? ? ? ? ? ?break;
> >
> > ? ? ? ?default:
> > @@ -44,6 +38,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
> > ? ? ? ? ? ? ? ?return -EINVAL;
> > ? ? ? ?}
> >
> > + ? ? ? s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(2));
> > ? ? ? ?return 0;
> > ?}
> >
> > @@ -111,21 +106,15 @@ struct platform_device s5p6442_device_iis1 = {
> >
> > ?static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
> > ?{
> > + ? ? ? unsigned int base;
> > +
> > ? ? ? ?switch (pdev->id) {
> > ? ? ? ?case 0:
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(0), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(1), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(2), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(3), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC0(4), S3C_GPIO_SFN(3));
> > + ? ? ? ? ? ? ? base = S5P6442_GPC0(0);
> > ? ? ? ? ? ? ? ?break;
> >
> > ? ? ? ?case 1:
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(0), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(1), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(2), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(3), S3C_GPIO_SFN(3));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPC1(4), S3C_GPIO_SFN(3));
> > + ? ? ? ? ? ? ? base = S5P6442_GPC1(0);
> > ? ? ? ? ? ? ? ?break;
> >
> > ? ? ? ?default:
> > @@ -133,6 +122,7 @@ static int s5p6442_pcm_cfg_gpio(struct platform_device *pdev)
> > ? ? ? ? ? ? ? ?return -EINVAL;
> > ? ? ? ?}
> >
> > + ? ? ? s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3));
> > ? ? ? ?return 0;
> > ?}
> >
> > diff --git a/arch/arm/mach-s5p6442/dev-spi.c b/arch/arm/mach-s5p6442/dev-spi.c
> > index 3019952..1c5c170 100644
> > --- a/arch/arm/mach-s5p6442/dev-spi.c
> > +++ b/arch/arm/mach-s5p6442/dev-spi.c
> > @@ -37,9 +37,7 @@ static int s5p6442_spi_cfg_gpio(struct platform_device *pdev)
> > ?{
> > ? ? ? ?switch (pdev->id) {
> > ? ? ? ?case 0:
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPB(0), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPB(2), S3C_GPIO_SFN(2));
> > - ? ? ? ? ? ? ? s3c_gpio_cfgpin(S5P6442_GPB(3), S3C_GPIO_SFN(2));
> > + ? ? ? ? ? ? ? s3c_gpio_cfgpin_range(S5P6442_GPB(0), 4, S3C_GPIO_SFN(2));
> 
> Where's the GPB(1)???

you're right, this is an invalid change. will back it out.
 
> Thank you,
> Kyungmin Park
> 
> > ? ? ? ? ? ? ? ?s3c_gpio_setpull(S5P6442_GPB(0), S3C_GPIO_PULL_UP);
> > ? ? ? ? ? ? ? ?s3c_gpio_setpull(S5P6442_GPB(2), S3C_GPIO_PULL_UP);
> > ? ? ? ? ? ? ? ?s3c_gpio_setpull(S5P6442_GPB(3), S3C_GPIO_PULL_UP);
> > --
> > 1.6.3.3
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> > the body of a message to majordomo at vger.kernel.org
> > More majordomo info at ?http://vger.kernel.org/majordomo-info.html
> >

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins
  2010-05-28  5:56 ` [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins Ben Dooks
@ 2010-05-28  9:53   ` Sergei Shtylyov
  0 siblings, 0 replies; 22+ messages in thread
From: Sergei Shtylyov @ 2010-05-28  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

Ben Dooks wrote:

> Add s3c_gpio_cfgpin_range() to configure a range of pins to the given
> value. This is useful for a number of blocks where the pins are in order
> and saves multiple calls to s3c_gpio_cfgpin().

> Signed-off-by: Ben Dooks <ben-linux@fluff.org>

    A little kerneldoc correction:

[...]

> diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> index 34efdd2..8ec9936 100644
> --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> @@ -89,6 +89,19 @@ extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to);
>   */
>  extern unsigned s3c_gpio_getcfg(unsigned int pin);
>  
> +/**
> + * s3c_gpio_cfgpin_range() - Change the GPIO function for configuring pin range
> + * @start: The pin number to start at
> + * @number: The number of pins to configure from @start.

    You call the parameter 'nr'.

> + * @cfg: The configuration for the pin's function
> + *
> + * Call s3c_gpio_cfgpin() for the @number pins starting at @start.
> + *
> + * @sa s3c_gpio_cfgpin.
> + */
> +extern int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
> +				 unsigned int cfg);
> +
>  /* Define values for the pull-{up,down} available for each gpio pin.
>   *
>   * These values control the state of the weak pull-{up,down} resistors

WBR, Sergei

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 08/15] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function
  2010-05-28  5:56 ` [PATCH 08/15] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Ben Dooks
@ 2010-05-28  9:56   ` Sergei Shtylyov
  0 siblings, 0 replies; 22+ messages in thread
From: Sergei Shtylyov @ 2010-05-28  9:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

Ben Dooks wrote:

> Add a function to configure a range of GPIOs function and
> pull in one go, mainly for the SDHCI and framebuffer helpers
> which tend to do this.

> Signed-off-by: Ben Dooks <ben-linux@fluff.org>

    Another little correction.

> diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
> index a927dd2..3a02e23 100644
> --- a/arch/arm/plat-samsung/gpio-config.c
> +++ b/arch/arm/plat-samsung/gpio-config.c
> @@ -56,6 +56,21 @@ int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
>  }
>  EXPORT_SYMBOL_GPL(s3c_gpio_cfgpin_range);
>  
> +int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr,
> +			  unsigned int cfg, s3c_gpio_pull_t pull)
> +{
> +	int ret;
> +
> +	for (; nr > 0; nr--, start++) {
> +		s3c_gpio_setpull(start, pull);
> +		ret = s3c_gpio_cfgpin(start, cfg);
> +		if (ret != 0)
> +			return ret;
> +	}
> +
> +}
> +EXPORT_SYMBOL_GPL(s3c_gpio_cfgall_range);
> +
>  unsigned s3c_gpio_getcfg(unsigned int pin)
>  {
>  	struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
> diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> index 8ec9936..bec872f 100644
> --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> @@ -161,4 +161,24 @@ extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin);
>  */
>  extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr);
>  
> +/* configure `all` aspects of an gpio */
> +
> +/**
> + * s3c_gpio_cfgall_range() - configure range of gpio functtion and pull.
> + * @gpio: The gpio number to start at.

    But you call it either 'start' ot 'pin'.

> + * @size: The number of gpio to configure.
> + * @cfg: The configuration to use
> + * @pull: The pull setting to use.
> + *
> + * Run s3c_gpio_cfgpin() and s3c_gpio_setpull() over the gpio range starting
> + * @gpio and running for @size.
> + *
> + * @sa s3c_gpio_cfgpin
> + * @sa s3c_gpio_setpull
> + * @sa s3c_gpio_cfgpin_range
> + */
> +extern int s3c_gpio_cfgall_range(unsigned int pin, unsigned int size,

   You call these parameters 'start' and 'nr' where the function is 
defined...

> +				 unsigned int cfg, s3c_gpio_pull_t pull);
> +
> +
>  #endif /* __PLAT_GPIO_CFG_H */

WBR, Sergei

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 05/15] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
  2010-05-28  6:24   ` Kyungmin Park
  2010-05-28  6:35     ` Ben Dooks
@ 2010-05-31  1:09     ` Ben Dooks
  2010-05-31  1:18       ` Kyungmin Park
  1 sibling, 1 reply; 22+ messages in thread
From: Ben Dooks @ 2010-05-31  1:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 28, 2010 at 03:24:02PM +0900, Kyungmin Park wrote:
> Hi,
> 
> Looks good but I'm afraid it's more difficult to find pin
> configuration from typo.

Do you meant that there's now no explicit mention of all pins invovled?

Note, may decided to drop or re-do this series.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 05/15] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
  2010-05-31  1:09     ` Ben Dooks
@ 2010-05-31  1:18       ` Kyungmin Park
  0 siblings, 0 replies; 22+ messages in thread
From: Kyungmin Park @ 2010-05-31  1:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 31, 2010 at 10:09 AM, Ben Dooks <ben-linux@fluff.org> wrote:
> On Fri, May 28, 2010 at 03:24:02PM +0900, Kyungmin Park wrote:
>> Hi,
>>
>> Looks good but I'm afraid it's more difficult to find pin
>> configuration from typo.
>
> Do you meant that there's now no explicit mention of all pins invovled?

When develop new device drivers, developers can be give wrong pin
number easily so can't find a what's the problem.

So how about to add sysfs which pins have function number to check it easily?

>
> Note, may decided to drop or re-do this series.

I vote for working continuously .

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-05-31  1:18 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28  5:56 GPIO updates for -next Ben Dooks
2010-05-28  5:56 ` [PATCH 01/15] ARM: SAMSUNG: Add GPIO configuration for a range of pins Ben Dooks
2010-05-28  9:53   ` Sergei Shtylyov
2010-05-28  5:56 ` [PATCH 02/15] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions Ben Dooks
2010-05-28  5:56 ` [PATCH 03/15] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Ben Dooks
2010-05-28  5:56 ` [PATCH 04/15] ARM: S5P6440: " Ben Dooks
2010-05-28  5:56 ` [PATCH 05/15] ARM: S5P6442: " Ben Dooks
2010-05-28  6:24   ` Kyungmin Park
2010-05-28  6:35     ` Ben Dooks
2010-05-31  1:09     ` Ben Dooks
2010-05-31  1:18       ` Kyungmin Park
2010-05-28  5:56 ` [PATCH 06/15] ARM: S5PC100: " Ben Dooks
2010-05-28  5:56 ` [PATCH 07/15] ARM: S5PV210: " Ben Dooks
2010-05-28  5:56 ` [PATCH 08/15] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Ben Dooks
2010-05-28  9:56   ` Sergei Shtylyov
2010-05-28  5:56 ` [PATCH 09/15] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range() Ben Dooks
2010-05-28  5:56 ` [PATCH 10/15] ARM: S5PC100: " Ben Dooks
2010-05-28  5:56 ` [PATCH 11/15] ARM: S5PV210: " Ben Dooks
2010-05-28  5:56 ` [PATCH 12/15] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper Ben Dooks
2010-05-28  5:56 ` [PATCH 13/15] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull() Ben Dooks
2010-05-28  5:56 ` [PATCH 14/15] ARM: S5PC100: " Ben Dooks
2010-05-28  5:56 ` [PATCH 15/15] ARM: S5PV210: " Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).