* [PATCH 00/27] ARM: SAMSUNG: GPIO updates
@ 2010-10-01 12:04 Kukjin Kim
2010-10-01 12:04 ` [PATCH 01/27] ARM: SAMSUNG: Add GPIO configuration for a range of pins Kukjin Kim
` (26 more replies)
0 siblings, 27 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:04 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux
This patch adds some helpers to do common jobs in the kernel to
reduce image and code size. The basic patches of this have been
submitted by Ben Dooks several month ago.
Basically, used Ben's original GPIO update patches and added
some missed GPIO updates from the previous patch.
[PATCH 01/27] ARM: SAMSUNG: Add GPIO configuration for a range of pins
[PATCH 02/27] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions
[PATCH 03/27] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range()
[PATCH 04/27] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
[PATCH 05/27] ARM: S5P64X0: Change to using s3c_gpio_cfgpin_range()
[PATCH 06/27] ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgpin_range()
[PATCH 07/27] ARM: S5PC100: Change to using s3c_gpio_cfgpin_range()
[PATCH 08/27] ARM: S5PV210: Change to using s3c_gpio_cfgpin_range()
[PATCH 09/27] ARM: S5PV310: Change to using s3c_gpio_cfgpin_range()
[PATCH 10/27] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function
[PATCH 11/27] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range()
[PATCH 12/27] ARM: S5P6442: Change to using s3c_gpio_cfgall_range()
[PATCH 13/27] ARM: S5P64X0: Change to using s3c_gpio_cfgall_range()
[PATCH 14/27] ARM: S5PC100: Change to using s3c_gpio_cfgall_range()
[PATCH 15/27] ARM: S5PV210: Change to using s3c_gpio_cfgall_range()
[PATCH 16/27] ARM: S5PV310: Change to using s3c_gpio_cfgall_range()
[PATCH 17/27] ARM: S3C64XX: 2nd Change to using s3c_gpio_cfgall_range()
[PATCH 18/27] ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgall_range()
[PATCH 19/27] ARM: S5PC100: 2nd Change to using s3c_gpio_cfgall_range()
[PATCH 20/27] ARM: S5PV210: 2nd Change to using s3c_gpio_cfgall_range()
[PATCH 21/27] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper
[PATCH 22/27] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull()
[PATCH 23/27] ARM: S5PC100: Change to using s3c_gpio_cfgrange_nopull()
[PATCH 24/27] ARM: S5PV210: Change to using s3c_gpio_cfgrange_nopull()
[PATCH 25/27] ARM: S3C64XX: 2nd Change to using s3c_gpio_cfgrange_nopull()
[PATCH 26/27] ARM: S5PC100: 2nd Change to using s3c_gpio_cfgrange_nopull()
[PATCH 27/27] ARM: S5PV210: 2nd Change to using s3c_gpio_cfgrange_nopull()
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 01/27] ARM: SAMSUNG: Add GPIO configuration for a range of pins
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
@ 2010-10-01 12:04 ` Kukjin Kim
2010-10-01 12:04 ` [PATCH 02/27] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions Kukjin Kim
` (25 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:04 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
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 e3d41ea..fa180dc 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 5b43b95..5fa3d89 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -108,6 +108,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
+ * @nr: The number of pins to configure from @start.
+ * @cfg: The configuration for the pin's function
+ *
+ * Call s3c_gpio_cfgpin() for the @nr 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.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 02/27] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
2010-10-01 12:04 ` [PATCH 01/27] ARM: SAMSUNG: Add GPIO configuration for a range of pins Kukjin Kim
@ 2010-10-01 12:04 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 03/27] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Kukjin Kim
` (24 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:04 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
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 9648fbc..3787811 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.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 03/27] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
2010-10-01 12:04 ` [PATCH 01/27] ARM: SAMSUNG: Add GPIO configuration for a range of pins Kukjin Kim
2010-10-01 12:04 ` [PATCH 02/27] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 04/27] ARM: S5P6442: " Kukjin Kim
` (23 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
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 3787811..e4bb023 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 3223595..0655c7a 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -30,8 +30,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);
}
@@ -50,8 +50,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);
}
@@ -69,14 +69,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.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 04/27] ARM: S5P6442: Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (2 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 03/27] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 05/27] ARM: S5P64X0: " Kukjin Kim
` (22 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
[kgene.kim@samsung.com: fixed wrong change]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p6442/dev-audio.c | 30 ++++++++++--------------------
arch/arm/mach-s5p6442/dev-spi.c | 3 +--
2 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/arch/arm/mach-s5p6442/dev-audio.c b/arch/arm/mach-s5p6442/dev-audio.c
index 7a4e347..3462197 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 e894651..547c570 100644
--- a/arch/arm/mach-s5p6442/dev-spi.c
+++ b/arch/arm/mach-s5p6442/dev-spi.c
@@ -38,8 +38,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(2), 2, 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.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 05/27] ARM: S5P64X0: Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (3 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 04/27] ARM: S5P6442: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 06/27] ARM: S5P64X0: 2nd " Kukjin Kim
` (21 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
[kgene.kim@samsung.com: modified to s5p64x0 from s5p6440]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p64x0/dev-audio.c | 26 +++++++-------------------
1 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c
index fa097bd..396bacc 100644
--- a/arch/arm/mach-s5p64x0/dev-audio.c
+++ b/arch/arm/mach-s5p64x0/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:
@@ -47,13 +42,9 @@ static int s5p6450_cfg_i2s(struct platform_device *pdev)
switch (pdev->id) {
case -1:
s3c_gpio_cfgpin(S5P6450_GPB(4), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(4), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(5), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(6), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(7), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(8), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(13), S3C_GPIO_SFN(5));
- s3c_gpio_cfgpin(S5P6450_GPR(14), S3C_GPIO_SFN(5));
+ s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5));
+ s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5));
+
break;
default:
@@ -116,11 +107,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(6), 3, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(2));
break;
default:
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 06/27] ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (4 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 05/27] ARM: S5P64X0: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-02 1:23 ` Kyungmin Park
2010-10-01 12:05 ` [PATCH 07/27] ARM: S5PC100: " Kukjin Kim
` (20 subsequent siblings)
26 siblings, 1 reply; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes the code setting ranges of GPIO pins in mach-s5p64x0 using
s3c_gpio_cfgpin() to use the recently introduced s3c_gpio_cfgpin_range().
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p64x0/dev-spi.c | 24 ++++++++++++------------
arch/arm/mach-s5p64x0/setup-i2c0.c | 6 ++----
arch/arm/mach-s5p64x0/setup-i2c1.c | 6 ++----
3 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c
index 5b69ec4..be64fee 100644
--- a/arch/arm/mach-s5p64x0/dev-spi.c
+++ b/arch/arm/mach-s5p64x0/dev-spi.c
@@ -39,20 +39,18 @@ static char *s5p64x0_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);
@@ -63,25 +61,25 @@ static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
return -EINVAL;
}
+ s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
+
return 0;
}
static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
{
+ unsigned int base;
+
switch (pdev->id) {
case 0:
- s3c_gpio_cfgpin(S5P6450_GPC(0), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5P6450_GPC(1), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5P6450_GPC(2), S3C_GPIO_SFN(2));
+ base = S5P6450_GPC(0);
s3c_gpio_setpull(S5P6450_GPC(0), S3C_GPIO_PULL_UP);
s3c_gpio_setpull(S5P6450_GPC(1), S3C_GPIO_PULL_UP);
s3c_gpio_setpull(S5P6450_GPC(2), S3C_GPIO_PULL_UP);
break;
case 1:
- s3c_gpio_cfgpin(S5P6450_GPC(4), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5P6450_GPC(5), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5P6450_GPC(6), S3C_GPIO_SFN(2));
+ base = S5P6450_GPC(4);
s3c_gpio_setpull(S5P6450_GPC(4), S3C_GPIO_PULL_UP);
s3c_gpio_setpull(S5P6450_GPC(5), S3C_GPIO_PULL_UP);
s3c_gpio_setpull(S5P6450_GPC(6), S3C_GPIO_PULL_UP);
@@ -92,6 +90,8 @@ static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
return -EINVAL;
}
+ s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
+
return 0;
}
diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c
index dc4cc65..75ef9e5 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c0.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c0.c
@@ -25,17 +25,15 @@ struct platform_device; /* don't need the contents */
void s5p6440_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5P6440_GPB(5), S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(S5P6440_GPB(5), 2, S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5P6440_GPB(5), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5P6440_GPB(6), S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5P6440_GPB(6), S3C_GPIO_PULL_UP);
}
void s5p6450_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5P6450_GPB(5), S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(S5P6450_GPB(5), 2, S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5P6450_GPB(5), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5P6450_GPB(6), S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5P6450_GPB(6), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5p64x0/setup-i2c1.c b/arch/arm/mach-s5p64x0/setup-i2c1.c
index 2edd791..5d5dd3c 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c1.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c1.c
@@ -25,17 +25,15 @@ struct platform_device; /* don't need the contents */
void s5p6440_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5P6440_GPR(9), S3C_GPIO_SFN(6));
+ s3c_gpio_cfgpin_range(S5P6440_GPR(9), 2, S3C_GPIO_SFN(6));
s3c_gpio_setpull(S5P6440_GPR(9), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5P6440_GPR(10), S3C_GPIO_SFN(6));
s3c_gpio_setpull(S5P6440_GPR(10), S3C_GPIO_PULL_UP);
}
void s5p6450_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5P6450_GPR(9), S3C_GPIO_SFN(6));
+ s3c_gpio_cfgpin_range(S5P6450_GPR(9), 2, S3C_GPIO_SFN(6));
s3c_gpio_setpull(S5P6450_GPR(9), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5P6450_GPR(10), S3C_GPIO_SFN(6));
s3c_gpio_setpull(S5P6450_GPR(10), S3C_GPIO_PULL_UP);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 07/27] ARM: S5PC100: Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (5 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 06/27] ARM: S5P64X0: 2nd " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 08/27] ARM: S5PV210: " Kukjin Kim
` (19 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
[kgene.kim@samsung.com: Fixed wrong change]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pc100/dev-audio.c | 32 ++++-------------------------
arch/arm/mach-s5pc100/dev-spi.c | 11 ++-------
arch/arm/mach-s5pc100/setup-sdhci-gpio.c | 15 +++++--------
3 files changed, 14 insertions(+), 44 deletions(-)
diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c
index a699ed6..7f6d01e 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 a0ef7c3..c1c5aed 100644
--- a/arch/arm/mach-s5pc100/dev-spi.c
+++ b/arch/arm/mach-s5pc100/dev-spi.c
@@ -38,18 +38,14 @@ static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
{
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));
+ s3c_gpio_cfgpin_range(S5PC100_GPB(0), 3, S3C_GPIO_SFN(2));
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));
+ s3c_gpio_cfgpin_range(S5PC100_GPB(4), 3, S3C_GPIO_SFN(2));
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);
@@ -57,8 +53,7 @@ static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
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));
+ s3c_gpio_cfgpin_range(S5PC100_GPB(2), 2, S3C_GPIO_SFN(3));
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);
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index dc7208c..79b031f 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -37,10 +37,9 @@ 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 */
- for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ 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);
- }
if (width == 8) {
for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) {
@@ -64,10 +63,9 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
end = S5PC100_GPG2(2 + width);
/* 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_cfgpin_range(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));
+ for (gpio = S5PC100_GPG2(0); gpio < end; gpio++)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
@@ -84,10 +82,9 @@ void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
end = S5PC100_GPG3(2 + width);
/* 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_cfgpin_range(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));
+ for (gpio = S5PC100_GPG3(0); gpio < end; gpio++)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 08/27] ARM: S5PV210: Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (6 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 07/27] ARM: S5PC100: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 09/27] ARM: S5PV310: " Kukjin Kim
` (18 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
[kgene.kim@samsung.com: coding-style fixes]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv210/dev-audio.c | 46 ++++----------------------
arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 53 ++++++++++++-----------------
2 files changed, 29 insertions(+), 70 deletions(-)
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
index 21dc6cf..b274b6b 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 b18587b..7064278 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -29,23 +29,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 */
- for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
+
switch (width) {
case 8:
/* GPG1[3:6] special-funtion 3 */
- for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
case 4:
/* GPG0[3:6] special-funtion 2 */
- for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
default:
break;
}
@@ -62,16 +60,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 */
- for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
/* Data pin GPG1[3:6] to special-function 2 */
- for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(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);
- }
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
@@ -85,24 +81,21 @@ 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 */
- for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
switch (width) {
case 8:
/* Data pin GPG3[3:6] to special-function 3 */
- for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
case 4:
/* Data pin GPG2[3:6] to special-function 2 */
- for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(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);
- }
default:
break;
}
@@ -118,17 +111,15 @@ void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
- /* Set all the necessary GPG3[0:2] pins to special-function 2 */
- for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ /* Set all the necessary GPG3[0:1] pins to special-function 2 */
+ s3c_gpio_cfgpin_range(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2));
+ for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
/* Data pin GPG3[3:6] to special-function 2 */
- for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2));
+ for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 09/27] ARM: S5PV310: Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (7 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 08/27] ARM: S5PV210: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 10/27] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Kukjin Kim
` (17 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes the code setting ranges of GPIO pins in mach-s5pv310 using
s3c_gpio_cfgpin() to use the recently introduced s3c_gpio_cfgpin_range().
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv310/setup-i2c0.c | 3 +--
arch/arm/mach-s5pv310/setup-i2c1.c | 3 +--
arch/arm/mach-s5pv310/setup-i2c2.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-s5pv310/setup-i2c0.c b/arch/arm/mach-s5pv310/setup-i2c0.c
index 4367128..17c54c8 100644
--- a/arch/arm/mach-s5pv310/setup-i2c0.c
+++ b/arch/arm/mach-s5pv310/setup-i2c0.c
@@ -21,8 +21,7 @@ struct platform_device; /* don't need the contents */
void s3c_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PV310_GPD1(0), S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(S5PV310_GPD1(0), 2, S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5PV310_GPD1(0), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV310_GPD1(1), S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5PV310_GPD1(1), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv310/setup-i2c1.c b/arch/arm/mach-s5pv310/setup-i2c1.c
index 1ecd5bc..1740c9f 100644
--- a/arch/arm/mach-s5pv310/setup-i2c1.c
+++ b/arch/arm/mach-s5pv310/setup-i2c1.c
@@ -18,8 +18,7 @@ struct platform_device; /* don't need the contents */
void s3c_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PV310_GPD1(2), S3C_GPIO_SFN(2));
+ s3c_gpio_cfgpin_range(S5PV310_GPD1(2), 2, S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5PV310_GPD1(2), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV310_GPD1(3), S3C_GPIO_SFN(2));
s3c_gpio_setpull(S5PV310_GPD1(3), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv310/setup-i2c2.c b/arch/arm/mach-s5pv310/setup-i2c2.c
index 4c0d8de..860f77b 100644
--- a/arch/arm/mach-s5pv310/setup-i2c2.c
+++ b/arch/arm/mach-s5pv310/setup-i2c2.c
@@ -18,8 +18,7 @@ struct platform_device; /* don't need the contents */
void s3c_i2c2_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PV310_GPA0(6), S3C_GPIO_SFN(3));
+ s3c_gpio_cfgpin_range(S5PV310_GPA0(6), 2, S3C_GPIO_SFN(3));
s3c_gpio_setpull(S5PV310_GPA0(6), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV310_GPA0(7), S3C_GPIO_SFN(3));
s3c_gpio_setpull(S5PV310_GPA0(7), S3C_GPIO_PULL_UP);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 10/27] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (8 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 09/27] ARM: S5PV310: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 11/27] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range() Kukjin Kim
` (16 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
[kgene.kim@samsung.com: Fix small comments]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/plat-samsung/gpio-config.c | 16 ++++++++++++++++
arch/arm/plat-samsung/include/plat/gpio-cfg.h | 19 +++++++++++++++++++
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 fa180dc..8a37211 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -56,6 +56,22 @@ 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;
+ }
+
+ return 0;
+}
+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 5fa3d89..ef0f1e3 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -153,6 +153,25 @@ extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull);
*/
extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin);
+/* configure `all` aspects of an gpio */
+
+/**
+ * s3c_gpio_cfgall_range() - configure range of gpio functtion and pull.
+ * @start: The gpio number to start at.
+ * @nr: The number of gpio to configure from @start.
+ * @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 start, unsigned int nr,
+ unsigned int cfg, s3c_gpio_pull_t pull);
+
/* Define values for the drvstr available for each gpio pin.
*
* These values control the value of the output signal driver strength,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 11/27] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (9 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 10/27] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 12/27] ARM: S5P6442: " Kukjin Kim
` (15 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
[kgene.kim@samsung.com: Fix small comments]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s3c64xx/setup-fb-24bpp.c | 14 ++------
arch/arm/mach-s3c64xx/setup-sdhci-gpio.c | 45 ++++++++----------------------
2 files changed, 16 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
index 0007368..3b0dd12 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 0655c7a..4262f78 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -24,16 +24,10 @@
void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- 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);
- }
+ /* Set all the necessary GPG pins to special-function 2 */
+ s3c_gpio_cfgall_range(S3C64XX_GPG(0), 2 + width,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
@@ -44,16 +38,10 @@ void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- 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);
- }
+ /* Set all the necessary GPH pins to special-function 2 */
+ s3c_gpio_cfgall_range(S3C64XX_GPH(0), 2 + width,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
@@ -63,20 +51,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;
+ /* Set all the necessary GPH pins to special-function 3 */
+ s3c_gpio_cfgall_range(S3C64XX_GPH(6), width,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
- 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);
- }
-
- /* 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);
- }
+ /* Set all the necessary GPC pins to special-function 3 */
+ s3c_gpio_cfgall_range(S3C64XX_GPC(4), 2,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 12/27] ARM: S5P6442: Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (10 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 11/27] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range() Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 13/27] ARM: S5P64X0: " Kukjin Kim
` (14 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p6442/dev-spi.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-s5p6442/dev-spi.c b/arch/arm/mach-s5p6442/dev-spi.c
index 547c570..cce8c24 100644
--- a/arch/arm/mach-s5p6442/dev-spi.c
+++ b/arch/arm/mach-s5p6442/dev-spi.c
@@ -38,10 +38,9 @@ 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_range(S5P6442_GPB(2), 2, 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);
+ s3c_gpio_cfgall_range(S5P6442_GPB(2), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
break;
default:
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 13/27] ARM: S5P64X0: Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (11 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 12/27] ARM: S5P6442: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 14/27] ARM: S5PC100: " Kukjin Kim
` (13 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
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: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p64x0/dev-spi.c | 18 ++++--------------
arch/arm/mach-s5p64x0/setup-i2c0.c | 10 ++++------
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c
index be64fee..e78ee18 100644
--- a/arch/arm/mach-s5p64x0/dev-spi.c
+++ b/arch/arm/mach-s5p64x0/dev-spi.c
@@ -44,16 +44,10 @@ static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
switch (pdev->id) {
case 0:
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:
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);
break;
default:
@@ -61,7 +55,8 @@ static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
return -EINVAL;
}
- s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgall_range(base, 3,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
return 0;
}
@@ -73,16 +68,10 @@ static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
switch (pdev->id) {
case 0:
base = S5P6450_GPC(0);
- s3c_gpio_setpull(S5P6450_GPC(0), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6450_GPC(1), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6450_GPC(2), S3C_GPIO_PULL_UP);
break;
case 1:
base = S5P6450_GPC(4);
- s3c_gpio_setpull(S5P6450_GPC(4), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6450_GPC(5), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6450_GPC(6), S3C_GPIO_PULL_UP);
break;
default:
@@ -90,7 +79,8 @@ static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
return -EINVAL;
}
- s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgall_range(base, 3,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
return 0;
}
diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c
index 75ef9e5..46b4639 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c0.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c0.c
@@ -25,16 +25,14 @@ struct platform_device; /* don't need the contents */
void s5p6440_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5P6440_GPB(5), 2, S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5P6440_GPB(5), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6440_GPB(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5P6440_GPB(5), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
void s5p6450_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5P6450_GPB(5), 2, S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5P6450_GPB(5), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6450_GPB(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5P6450_GPB(5), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
void s3c_i2c0_cfg_gpio(struct platform_device *dev) { }
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 14/27] ARM: S5PC100: Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (12 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 13/27] ARM: S5P64X0: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 15/27] ARM: S5PV210: " Kukjin Kim
` (12 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pc100/setup-fb-24bpp.c | 30 +++++++-----------------
arch/arm/mach-s5pc100/setup-sdhci-gpio.c | 36 +++++++----------------------
2 files changed, 18 insertions(+), 48 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 79b031f..a8d22a7 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -25,8 +25,6 @@
void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- unsigned int gpio;
- unsigned int end;
unsigned int num;
num = width;
@@ -34,19 +32,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);
- }
- }
+ if (width == 8)
+ s3c_gpio_cfgall_range(S5PC100_GPG1(0), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
@@ -57,15 +49,10 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- unsigned int gpio;
- unsigned int end;
-
- end = S5PC100_GPG2(2 + width);
/* Set all the necessary GPG2 pins to special-function 2 */
- s3c_gpio_cfgpin_range(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(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);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
@@ -76,15 +63,10 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- unsigned int gpio;
- unsigned int end;
-
- end = S5PC100_GPG3(2 + width);
/* Set all the necessary GPG3 pins to special-function 2 */
- s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(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);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 15/27] ARM: S5PV210: Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (13 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 14/27] ARM: S5PC100: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 16/27] ARM: S5PV310: " Kukjin Kim
` (11 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv210/setup-fb-24bpp.c | 34 ++++++-------------
arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 54 +++++++++++-------------------
2 files changed, 31 insertions(+), 57 deletions(-)
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
index 928cf1f..a33fe96 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, nr, 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);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
+ for (; nr > 0; nr--, base++)
+ s5p_gpio_set_drvstr(base, 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 7064278..f5499ae 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -26,24 +26,20 @@
void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- 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;
}
@@ -57,17 +53,14 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- 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_range(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);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
@@ -78,24 +71,20 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- 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;
}
@@ -109,17 +98,14 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
{
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
- unsigned int gpio;
/* Set all the necessary GPG3[0:1] pins to special-function 2 */
- s3c_gpio_cfgpin_range(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2));
- for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++)
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgall_range(S5PV210_GPG3(0), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
/* Data pin GPG3[3:6] to special-function 2 */
- s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2));
- 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(2), S3C_GPIO_PULL_NONE);
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 16/27] ARM: S5PV310: Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (14 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 15/27] ARM: S5PV210: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 17/27] ARM: S3C64XX: 2nd " Kukjin Kim
` (10 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv310/setup-i2c0.c | 5 ++---
arch/arm/mach-s5pv310/setup-i2c1.c | 5 ++---
arch/arm/mach-s5pv310/setup-i2c2.c | 5 ++---
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-s5pv310/setup-i2c0.c b/arch/arm/mach-s5pv310/setup-i2c0.c
index 17c54c8..f47f8f3 100644
--- a/arch/arm/mach-s5pv310/setup-i2c0.c
+++ b/arch/arm/mach-s5pv310/setup-i2c0.c
@@ -21,7 +21,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5PV310_GPD1(0), 2, S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV310_GPD1(0), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV310_GPD1(1), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PV310_GPD1(0), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv310/setup-i2c1.c b/arch/arm/mach-s5pv310/setup-i2c1.c
index 1740c9f..9d07e4e 100644
--- a/arch/arm/mach-s5pv310/setup-i2c1.c
+++ b/arch/arm/mach-s5pv310/setup-i2c1.c
@@ -18,7 +18,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5PV310_GPD1(2), 2, S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV310_GPD1(2), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV310_GPD1(3), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PV310_GPD1(2), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv310/setup-i2c2.c b/arch/arm/mach-s5pv310/setup-i2c2.c
index 860f77b..ad0f431 100644
--- a/arch/arm/mach-s5pv310/setup-i2c2.c
+++ b/arch/arm/mach-s5pv310/setup-i2c2.c
@@ -18,7 +18,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c2_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5PV310_GPA0(6), 2, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(S5PV310_GPA0(6), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV310_GPA0(7), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin_range(S5PV310_GPA0(6), 2,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 17/27] ARM: S3C64XX: 2nd Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (15 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 16/27] ARM: S5PV310: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 18/27] ARM: S5P64X0: " Kukjin Kim
` (9 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes the code setting range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgpin_range().
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s3c64xx/setup-ide.c | 10 +++-------
arch/arm/mach-s3c64xx/setup-keypad.c | 17 ++++-------------
2 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/setup-ide.c b/arch/arm/mach-s3c64xx/setup-ide.c
index c12c315..de645e9 100644
--- a/arch/arm/mach-s3c64xx/setup-ide.c
+++ b/arch/arm/mach-s3c64xx/setup-ide.c
@@ -21,7 +21,6 @@
void s3c64xx_ide_setup_gpio(void)
{
u32 reg;
- u32 gpio = 0;
reg = readl(S3C_MEM_SYS_CFG) & (~0x3f);
@@ -32,15 +31,12 @@ void s3c64xx_ide_setup_gpio(void)
s3c_gpio_cfgpin(S3C64XX_GPB(4), S3C_GPIO_SFN(4));
/* Set XhiDATA[15:0] pins as CF Data[15:0] */
- for (gpio = S3C64XX_GPK(0); gpio <= S3C64XX_GPK(15); gpio++)
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(5));
+ s3c_gpio_cfgpin_range(S3C64XX_GPK(0), 16, S3C_GPIO_SFN(5));
/* Set XhiADDR[2:0] pins as CF ADDR[2:0] */
- for (gpio = S3C64XX_GPL(0); gpio <= S3C64XX_GPL(2); gpio++)
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(6));
+ s3c_gpio_cfgpin_range(S3C64XX_GPL(0), 3, S3C_GPIO_SFN(6));
/* Set Xhi ctrl pins as CF ctrl pins(IORDY, IOWR, IORD, CE[0:1]) */
s3c_gpio_cfgpin(S3C64XX_GPM(5), S3C_GPIO_SFN(1));
- for (gpio = S3C64XX_GPM(0); gpio <= S3C64XX_GPM(4); gpio++)
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(6));
+ s3c_gpio_cfgpin_range(S3C64XX_GPM(0), 5, S3C_GPIO_SFN(6));
}
diff --git a/arch/arm/mach-s3c64xx/setup-keypad.c b/arch/arm/mach-s3c64xx/setup-keypad.c
index abc34e4..cc9b09c 100644
--- a/arch/arm/mach-s3c64xx/setup-keypad.c
+++ b/arch/arm/mach-s3c64xx/setup-keypad.c
@@ -15,20 +15,11 @@
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
- unsigned int gpio;
- unsigned int end;
-
/* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */
- end = S3C64XX_GPK(8 + rows);
- for (gpio = S3C64XX_GPK(8); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S3C64XX_GPK(8), 8 + rows,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
/* Set all the necessary GPL pins to special-function 3: KP_COL[x] */
- end = S3C64XX_GPL(0 + cols);
- for (gpio = S3C64XX_GPL(0); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S3C64XX_GPL(0), cols,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 18/27] ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (16 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 17/27] ARM: S3C64XX: 2nd " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 19/27] ARM: S5PC100: " Kukjin Kim
` (8 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes the code setting range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgpin_range().
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p64x0/setup-i2c1.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/setup-i2c1.c b/arch/arm/mach-s5p64x0/setup-i2c1.c
index 5d5dd3c..6ad3b98 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c1.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c1.c
@@ -25,16 +25,14 @@ struct platform_device; /* don't need the contents */
void s5p6440_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5P6440_GPR(9), 2, S3C_GPIO_SFN(6));
- s3c_gpio_setpull(S5P6440_GPR(9), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6440_GPR(10), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5P6440_GPR(9), 2,
+ S3C_GPIO_SFN(6), S3C_GPIO_PULL_UP);
}
void s5p6450_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin_range(S5P6450_GPR(9), 2, S3C_GPIO_SFN(6));
- s3c_gpio_setpull(S5P6450_GPR(9), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5P6450_GPR(10), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5P6450_GPR(9), 2,
+ S3C_GPIO_SFN(6), S3C_GPIO_PULL_UP);
}
void s3c_i2c1_cfg_gpio(struct platform_device *dev) { }
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 19/27] ARM: S5PC100: 2nd Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (17 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 18/27] ARM: S5P64X0: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 20/27] ARM: S5PV210: " Kukjin Kim
` (7 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes the code setting range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgpin_range().
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pc100/dev-spi.c | 17 +++++---------
arch/arm/mach-s5pc100/setup-i2c0.c | 6 +---
arch/arm/mach-s5pc100/setup-i2c1.c | 6 +---
arch/arm/mach-s5pc100/setup-ide.c | 42 ++++++++++++---------------------
arch/arm/mach-s5pc100/setup-keypad.c | 17 +++----------
5 files changed, 29 insertions(+), 59 deletions(-)
diff --git a/arch/arm/mach-s5pc100/dev-spi.c b/arch/arm/mach-s5pc100/dev-spi.c
index c1c5aed..57b1979 100644
--- a/arch/arm/mach-s5pc100/dev-spi.c
+++ b/arch/arm/mach-s5pc100/dev-spi.c
@@ -38,25 +38,20 @@ static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
{
switch (pdev->id) {
case 0:
- s3c_gpio_cfgpin_range(S5PC100_GPB(0), 3, S3C_GPIO_SFN(2));
- 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);
+ s3c_gpio_cfgall_range(S5PC100_GPB(0), 3,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
break;
case 1:
- s3c_gpio_cfgpin_range(S5PC100_GPB(4), 3, S3C_GPIO_SFN(2));
- 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);
+ s3c_gpio_cfgall_range(S5PC100_GPB(4), 3,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
break;
case 2:
s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3));
- s3c_gpio_cfgpin_range(S5PC100_GPB(2), 2, S3C_GPIO_SFN(3));
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);
+ s3c_gpio_cfgall_range(S5PC100_GPB(2), 2,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
break;
default:
diff --git a/arch/arm/mach-s5pc100/setup-i2c0.c b/arch/arm/mach-s5pc100/setup-i2c0.c
index dd3174e..eaef7a3 100644
--- a/arch/arm/mach-s5pc100/setup-i2c0.c
+++ b/arch/arm/mach-s5pc100/setup-i2c0.c
@@ -23,8 +23,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PC100_GPD(3), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pc100/setup-i2c1.c b/arch/arm/mach-s5pc100/setup-i2c1.c
index d1fec26..aaff74a 100644
--- a/arch/arm/mach-s5pc100/setup-i2c1.c
+++ b/arch/arm/mach-s5pc100/setup-i2c1.c
@@ -23,8 +23,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PC100_GPD(5), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PC100_GPD(5), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PC100_GPD(6), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PC100_GPD(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PC100_GPD(5), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pc100/setup-ide.c b/arch/arm/mach-s5pc100/setup-ide.c
index 8357567..d8b0d0e 100644
--- a/arch/arm/mach-s5pc100/setup-ide.c
+++ b/arch/arm/mach-s5pc100/setup-ide.c
@@ -17,52 +17,40 @@
#include <mach/regs-clock.h>
#include <plat/gpio-cfg.h>
+static void s5pc100_ide_cfg_gpios(unsigned int base, unsigned int nr)
+{
+ s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(4), S3C_GPIO_PULL_NONE);
+
+ for (; nr > 0; nr--, base++)
+ s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
+}
+
void s5pc100_ide_setup_gpio(void)
{
u32 reg;
- u32 gpio = 0;
/* Independent CF interface, CF chip select configuration */
reg = readl(S5PC100_MEM_SYS_CFG) & (~0x3f);
writel(reg | MEM_SYS_CFG_EBI_FIX_PRI_CFCON, S5PC100_MEM_SYS_CFG);
/* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST, CF_DMACK */
- for (gpio = S5PC100_GPJ0(0); gpio <= S5PC100_GPJ0(7); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
+ s5pc100_ide_cfg_gpios(S5PC100_GPJ0(0), 8);
/*CF_Data[0 - 7] */
- for (gpio = S5PC100_GPJ2(0); gpio <= S5PC100_GPJ2(7); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
+ s5pc100_ide_cfg_gpios(S5PC100_GPJ2(0), 8);
/* CF_Data[8 - 15] */
- for (gpio = S5PC100_GPJ3(0); gpio <= S5PC100_GPJ3(7); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
+ s5pc100_ide_cfg_gpios(S5PC100_GPJ3(0), 8);
/* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */
- for (gpio = S5PC100_GPJ4(0); gpio <= S5PC100_GPJ4(3); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
+ s5pc100_ide_cfg_gpios(S5PC100_GPJ4(0), 4);
/* EBI_OE, EBI_WE */
- for (gpio = S5PC100_GPK0(6); gpio <= S5PC100_GPK0(7); gpio++)
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0));
+ s3c_gpio_cfgpin_range(S5PC100_GPK0(6), 2, S3C_GPIO_SFN(0));
/* CF_OE, CF_WE */
- for (gpio = S5PC100_GPK1(6); gpio <= S5PC100_GPK1(7); gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S5PC100_GPK1(6), 8,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
/* CF_CD */
s3c_gpio_cfgpin(S5PC100_GPK3(5), S3C_GPIO_SFN(2));
diff --git a/arch/arm/mach-s5pc100/setup-keypad.c b/arch/arm/mach-s5pc100/setup-keypad.c
index d0837a7..966b49f 100644
--- a/arch/arm/mach-s5pc100/setup-keypad.c
+++ b/arch/arm/mach-s5pc100/setup-keypad.c
@@ -15,20 +15,11 @@
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
- unsigned int gpio;
- unsigned int end;
-
/* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */
- end = S5PC100_GPH3(rows);
- for (gpio = S5PC100_GPH3(0); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S5PC100_GPH3(0), rows,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
/* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */
- end = S5PC100_GPH2(cols);
- for (gpio = S5PC100_GPH2(0); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S5PC100_GPH2(0), cols,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 20/27] ARM: S5PV210: 2nd Change to using s3c_gpio_cfgall_range()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (18 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 19/27] ARM: S5PC100: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 21/27] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper Kukjin Kim
` (6 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes the code setting range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgpin_range().
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv210/dev-spi.c | 19 +++++--------
arch/arm/mach-s5pv210/setup-i2c0.c | 6 +---
arch/arm/mach-s5pv210/setup-i2c1.c | 6 +---
arch/arm/mach-s5pv210/setup-i2c2.c | 6 +---
arch/arm/mach-s5pv210/setup-ide.c | 49 +++++++++++++--------------------
arch/arm/mach-s5pv210/setup-keypad.c | 16 +++--------
6 files changed, 36 insertions(+), 66 deletions(-)
diff --git a/arch/arm/mach-s5pv210/dev-spi.c b/arch/arm/mach-s5pv210/dev-spi.c
index 826cdbc..e3249a4 100644
--- a/arch/arm/mach-s5pv210/dev-spi.c
+++ b/arch/arm/mach-s5pv210/dev-spi.c
@@ -35,23 +35,15 @@ static char *spi_src_clks[] = {
*/
static int s5pv210_spi_cfg_gpio(struct platform_device *pdev)
{
+ unsigned int base;
+
switch (pdev->id) {
case 0:
- s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5PV210_GPB(1), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5PV210_GPB(2), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV210_GPB(1), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV210_GPB(2), S3C_GPIO_PULL_UP);
+ base = S5PV210_GPB(0);
break;
case 1:
- s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5PV210_GPB(5), S3C_GPIO_SFN(2));
- s3c_gpio_cfgpin(S5PV210_GPB(6), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV210_GPB(5), S3C_GPIO_PULL_UP);
- s3c_gpio_setpull(S5PV210_GPB(6), S3C_GPIO_PULL_UP);
+ base = S5PV210_GPB(4);
break;
default:
@@ -59,6 +51,9 @@ static int s5pv210_spi_cfg_gpio(struct platform_device *pdev)
return -EINVAL;
}
+ s3c_gpio_cfgall_range(base, 3,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+
return 0;
}
diff --git a/arch/arm/mach-s5pv210/setup-i2c0.c b/arch/arm/mach-s5pv210/setup-i2c0.c
index d38f7cb..0f1cc3a 100644
--- a/arch/arm/mach-s5pv210/setup-i2c0.c
+++ b/arch/arm/mach-s5pv210/setup-i2c0.c
@@ -23,8 +23,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c0_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PV210_GPD1(0), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPD1(0), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV210_GPD1(1), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPD1(1), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PV210_GPD1(0), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv210/setup-i2c1.c b/arch/arm/mach-s5pv210/setup-i2c1.c
index 148bb78..f61365a 100644
--- a/arch/arm/mach-s5pv210/setup-i2c1.c
+++ b/arch/arm/mach-s5pv210/setup-i2c1.c
@@ -23,8 +23,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c1_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PV210_GPD1(2), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPD1(2), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV210_GPD1(3), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPD1(3), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PV210_GPD1(2), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv210/setup-i2c2.c b/arch/arm/mach-s5pv210/setup-i2c2.c
index 2396cb8..2f91b5c 100644
--- a/arch/arm/mach-s5pv210/setup-i2c2.c
+++ b/arch/arm/mach-s5pv210/setup-i2c2.c
@@ -23,8 +23,6 @@ struct platform_device; /* don't need the contents */
void s3c_i2c2_cfg_gpio(struct platform_device *dev)
{
- s3c_gpio_cfgpin(S5PV210_GPD1(4), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPD1(4), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV210_GPD1(5), S3C_GPIO_SFN(2));
- s3c_gpio_setpull(S5PV210_GPD1(5), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgall_range(S5PV210_GPD1(4), 2,
+ S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
diff --git a/arch/arm/mach-s5pv210/setup-ide.c b/arch/arm/mach-s5pv210/setup-ide.c
index b558b1c..d7cd10f 100644
--- a/arch/arm/mach-s5pv210/setup-ide.c
+++ b/arch/arm/mach-s5pv210/setup-ide.c
@@ -15,36 +15,25 @@
#include <plat/gpio-cfg.h>
+static void s5pv210_ide_cfg_gpios(unsigned int base, unsigned int nr)
+{
+ s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(4), S3C_GPIO_PULL_NONE);
+
+ for (; nr > 0; nr--, base++)
+ s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
+}
+
void s5pv210_ide_setup_gpio(void)
{
- unsigned int gpio = 0;
-
- for (gpio = S5PV210_GPJ0(0); gpio <= S5PV210_GPJ0(7); gpio++) {
- /* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST,
- CF_DMACK */
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
-
- for (gpio = S5PV210_GPJ2(0); gpio <= S5PV210_GPJ2(7); gpio++) {
- /*CF_Data[0 - 7] */
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
-
- for (gpio = S5PV210_GPJ3(0); gpio <= S5PV210_GPJ3(7); gpio++) {
- /* CF_Data[8 - 15] */
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
-
- for (gpio = S5PV210_GPJ4(0); gpio <= S5PV210_GPJ4(3); gpio++) {
- /* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
- }
+ /* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST, CF_DMACK */
+ s5pv210_ide_cfg_gpios(S5PV210_GPJ0(0), 8);
+
+ /* CF_Data[0 - 7] */
+ s5pv210_ide_cfg_gpios(S5PV210_GPJ2(0), 8);
+
+ /* CF_Data[8 - 15] */
+ s5pv210_ide_cfg_gpios(S5PV210_GPJ3(0), 8);
+
+ /* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */
+ s5pv210_ide_cfg_gpios(S5PV210_GPJ4(0), 4);
}
diff --git a/arch/arm/mach-s5pv210/setup-keypad.c b/arch/arm/mach-s5pv210/setup-keypad.c
index 37b2790..cb3f409 100644
--- a/arch/arm/mach-s5pv210/setup-keypad.c
+++ b/arch/arm/mach-s5pv210/setup-keypad.c
@@ -16,19 +16,11 @@
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
- unsigned int gpio, end;
-
/* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */
- end = S5PV210_GPH3(rows);
- for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S5PV210_GPH3(0), rows,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
/* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */
- end = S5PV210_GPH2(cols);
- for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {
- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
- }
+ s3c_gpio_cfgall_range(S5PV210_GPH2(0), cols,
+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 21/27] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (19 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 20/27] ARM: S5PV210: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 22/27] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull() Kukjin Kim
` (5 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
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 ef0f1e3..e4b5cf1 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -172,6 +172,12 @@ extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin);
extern int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr,
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);
+}
+
/* Define values for the drvstr available for each gpio pin.
*
* These values control the value of the output signal driver strength,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 22/27] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (20 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 21/27] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 23/27] ARM: S5PC100: " Kukjin Kim
` (4 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
Change 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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
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 4262f78..6eac071 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -26,8 +26,7 @@ void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* Set all the necessary GPG pins to special-function 2 */
- 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));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
@@ -40,8 +39,7 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* Set all the necessary GPH pins to special-function 2 */
- 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));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
@@ -52,10 +50,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 3 */
- 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 3 */
- 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.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 23/27] ARM: S5PC100: Change to using s3c_gpio_cfgrange_nopull()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (21 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 22/27] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull() Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 24/27] ARM: S5PV210: " Kukjin Kim
` (3 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
Change 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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pc100/setup-sdhci-gpio.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index a8d22a7..03c02d0 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -33,12 +33,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);
+ s3c_gpio_cfgrange_nopull(S5PC100_GPG1(0), 2, S3C_GPIO_SFN(2));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
@@ -51,8 +49,7 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* 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));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
@@ -65,8 +62,7 @@ void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* 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));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 24/27] ARM: S5PV210: Change to using s3c_gpio_cfgrange_nopull()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (22 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 23/27] ARM: S5PC100: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 25/27] ARM: S3C64XX: 2nd " Kukjin Kim
` (2 subsequent siblings)
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
From: Ben Dooks <ben-linux@fluff.org>
Change 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>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
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 f5499ae..927d588 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -34,12 +34,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;
}
@@ -55,12 +53,10 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* 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));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
@@ -73,18 +69,15 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* 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.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 25/27] ARM: S3C64XX: 2nd Change to using s3c_gpio_cfgrange_nopull()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (23 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 24/27] ARM: S5PV210: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 26/27] ARM: S5PC100: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 27/27] ARM: S5PV210: " Kukjin Kim
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes code setting special-function and no pull-up
to use the s3c_gpio_cfgrange_nopull() wrapper.
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s3c64xx/setup-fb-24bpp.c | 7 ++-----
arch/arm/mach-s3c64xx/setup-keypad.c | 6 ++----
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
index 3b0dd12..8f30911 100644
--- a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
+++ b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
@@ -23,9 +23,6 @@
extern void s3c64xx_fb_gpio_setup_24bpp(void)
{
- s3c_gpio_cfgall_range(S3C64XX_GPI(0), 16,
- S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
-
- s3c_gpio_cfgall_range(S3C64XX_GPJ(0), 12,
- S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2));
}
diff --git a/arch/arm/mach-s3c64xx/setup-keypad.c b/arch/arm/mach-s3c64xx/setup-keypad.c
index cc9b09c..d1fd722 100644
--- a/arch/arm/mach-s3c64xx/setup-keypad.c
+++ b/arch/arm/mach-s3c64xx/setup-keypad.c
@@ -16,10 +16,8 @@
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
/* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */
- s3c_gpio_cfgall_range(S3C64XX_GPK(8), 8 + rows,
- S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 8 + rows, S3C_GPIO_SFN(3));
/* Set all the necessary GPL pins to special-function 3: KP_COL[x] */
- s3c_gpio_cfgall_range(S3C64XX_GPL(0), cols,
- S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3));
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 26/27] ARM: S5PC100: 2nd Change to using s3c_gpio_cfgrange_nopull()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (24 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 25/27] ARM: S3C64XX: 2nd " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 27/27] ARM: S5PV210: " Kukjin Kim
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes code setting special-function and no pull-up
to use the s3c_gpio_cfgrange_nopull() wrapper.
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pc100/setup-fb-24bpp.c | 2 +-
arch/arm/mach-s5pc100/setup-ide.c | 5 ++---
arch/arm/mach-s5pc100/setup-keypad.c | 6 ++----
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-s5pc100/setup-fb-24bpp.c b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
index 5a882d4..d31c0f3 100644
--- a/arch/arm/mach-s5pc100/setup-fb-24bpp.c
+++ b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
@@ -24,7 +24,7 @@
static void s5pc100_fb_setgpios(unsigned int base, unsigned int nr)
{
- s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(2));
}
void s5pc100_fb_gpio_setup_24bpp(void)
diff --git a/arch/arm/mach-s5pc100/setup-ide.c b/arch/arm/mach-s5pc100/setup-ide.c
index d8b0d0e..223aae0 100644
--- a/arch/arm/mach-s5pc100/setup-ide.c
+++ b/arch/arm/mach-s5pc100/setup-ide.c
@@ -19,7 +19,7 @@
static void s5pc100_ide_cfg_gpios(unsigned int base, unsigned int nr)
{
- s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(4), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(4));
for (; nr > 0; nr--, base++)
s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
@@ -49,8 +49,7 @@ void s5pc100_ide_setup_gpio(void)
s3c_gpio_cfgpin_range(S5PC100_GPK0(6), 2, S3C_GPIO_SFN(0));
/* CF_OE, CF_WE */
- s3c_gpio_cfgall_range(S5PC100_GPK1(6), 8,
- S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PC100_GPK1(6), 8, S3C_GPIO_SFN(2));
/* CF_CD */
s3c_gpio_cfgpin(S5PC100_GPK3(5), S3C_GPIO_SFN(2));
diff --git a/arch/arm/mach-s5pc100/setup-keypad.c b/arch/arm/mach-s5pc100/setup-keypad.c
index 966b49f..ada377f 100644
--- a/arch/arm/mach-s5pc100/setup-keypad.c
+++ b/arch/arm/mach-s5pc100/setup-keypad.c
@@ -16,10 +16,8 @@
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
/* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */
- s3c_gpio_cfgall_range(S5PC100_GPH3(0), rows,
- S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PC100_GPH3(0), rows, S3C_GPIO_SFN(3));
/* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */
- s3c_gpio_cfgall_range(S5PC100_GPH2(0), cols,
- S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PC100_GPH2(0), cols, S3C_GPIO_SFN(3));
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 27/27] ARM: S5PV210: 2nd Change to using s3c_gpio_cfgrange_nopull()
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
` (25 preceding siblings ...)
2010-10-01 12:05 ` [PATCH 26/27] ARM: S5PC100: " Kukjin Kim
@ 2010-10-01 12:05 ` Kukjin Kim
26 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-01 12:05 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Kukjin Kim
This patch changes code setting special-function and no pull-up
to use the s3c_gpio_cfgrange_nopull() wrapper.
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv210/setup-fb-24bpp.c | 2 +-
arch/arm/mach-s5pv210/setup-ide.c | 2 +-
arch/arm/mach-s5pv210/setup-keypad.c | 6 ++----
arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 9 +++------
4 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
index a33fe96..e932ebf 100644
--- a/arch/arm/mach-s5pv210/setup-fb-24bpp.c
+++ b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
@@ -23,7 +23,7 @@
static void s5pv210_fb_cfg_gpios(unsigned int base, unsigned int nr)
{
- s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(2));
for (; nr > 0; nr--, base++)
s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
diff --git a/arch/arm/mach-s5pv210/setup-ide.c b/arch/arm/mach-s5pv210/setup-ide.c
index d7cd10f..ea123d5 100644
--- a/arch/arm/mach-s5pv210/setup-ide.c
+++ b/arch/arm/mach-s5pv210/setup-ide.c
@@ -17,7 +17,7 @@
static void s5pv210_ide_cfg_gpios(unsigned int base, unsigned int nr)
{
- s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(4), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(4));
for (; nr > 0; nr--, base++)
s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
diff --git a/arch/arm/mach-s5pv210/setup-keypad.c b/arch/arm/mach-s5pv210/setup-keypad.c
index cb3f409..c56420a 100644
--- a/arch/arm/mach-s5pv210/setup-keypad.c
+++ b/arch/arm/mach-s5pv210/setup-keypad.c
@@ -17,10 +17,8 @@
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
/* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */
- s3c_gpio_cfgall_range(S5PV210_GPH3(0), rows,
- S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PV210_GPH3(0), rows, S3C_GPIO_SFN(3));
/* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */
- s3c_gpio_cfgall_range(S5PV210_GPH2(0), cols,
- S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PV210_GPH2(0), cols, S3C_GPIO_SFN(3));
}
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index 927d588..746777d 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -28,8 +28,7 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* Set all the necessary GPG0/GPG1 pins to special-function 2 */
- s3c_gpio_cfgall_range(S5PV210_GPG0(0), 2,
- S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2));
switch (width) {
case 8:
@@ -93,12 +92,10 @@ void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
/* Set all the necessary GPG3[0:1] pins to special-function 2 */
- s3c_gpio_cfgall_range(S5PV210_GPG3(0), 2,
- S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2));
/* Data pin GPG3[3:6] to special-function 2 */
- s3c_gpio_cfgall_range(S5PV210_GPG3(3), 4,
- S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2));
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 06/27] ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgpin_range()
2010-10-01 12:05 ` [PATCH 06/27] ARM: S5P64X0: 2nd " Kukjin Kim
@ 2010-10-02 1:23 ` Kyungmin Park
2010-10-02 11:16 ` Kukjin Kim
0 siblings, 1 reply; 30+ messages in thread
From: Kyungmin Park @ 2010-10-02 1:23 UTC (permalink / raw)
To: Kukjin Kim; +Cc: linux-arm-kernel, linux-samsung-soc, ben-linux
Hi,
On Fri, Oct 1, 2010 at 9:05 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> This patch changes the code setting ranges of GPIO pins in mach-s5p64x0 using
> s3c_gpio_cfgpin() to use the recently introduced s3c_gpio_cfgpin_range().
> NOTE: This is for missed things from the previous patch.
>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> arch/arm/mach-s5p64x0/dev-spi.c | 24 ++++++++++++------------
> arch/arm/mach-s5p64x0/setup-i2c0.c | 6 ++----
> arch/arm/mach-s5p64x0/setup-i2c1.c | 6 ++----
> 3 files changed, 16 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c
> index 5b69ec4..be64fee 100644
> --- a/arch/arm/mach-s5p64x0/dev-spi.c
> +++ b/arch/arm/mach-s5p64x0/dev-spi.c
> @@ -39,20 +39,18 @@ static char *s5p64x0_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);
Also make a wrapper, s3c_gpio_cfgrange_pullup, then you can also
remove above codes.
There's lots of codes use PULL_UP as default pin setup.
Thank you,
Kyungmin Park
> 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);
> @@ -63,25 +61,25 @@ static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
> return -EINVAL;
> }
>
> + s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
> +
> return 0;
> }
>
> static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
> {
> + unsigned int base;
> +
> switch (pdev->id) {
> case 0:
> - s3c_gpio_cfgpin(S5P6450_GPC(0), S3C_GPIO_SFN(2));
> - s3c_gpio_cfgpin(S5P6450_GPC(1), S3C_GPIO_SFN(2));
> - s3c_gpio_cfgpin(S5P6450_GPC(2), S3C_GPIO_SFN(2));
> + base = S5P6450_GPC(0);
> s3c_gpio_setpull(S5P6450_GPC(0), S3C_GPIO_PULL_UP);
> s3c_gpio_setpull(S5P6450_GPC(1), S3C_GPIO_PULL_UP);
> s3c_gpio_setpull(S5P6450_GPC(2), S3C_GPIO_PULL_UP);
> break;
>
> case 1:
> - s3c_gpio_cfgpin(S5P6450_GPC(4), S3C_GPIO_SFN(2));
> - s3c_gpio_cfgpin(S5P6450_GPC(5), S3C_GPIO_SFN(2));
> - s3c_gpio_cfgpin(S5P6450_GPC(6), S3C_GPIO_SFN(2));
> + base = S5P6450_GPC(4);
> s3c_gpio_setpull(S5P6450_GPC(4), S3C_GPIO_PULL_UP);
> s3c_gpio_setpull(S5P6450_GPC(5), S3C_GPIO_PULL_UP);
> s3c_gpio_setpull(S5P6450_GPC(6), S3C_GPIO_PULL_UP);
> @@ -92,6 +90,8 @@ static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
> return -EINVAL;
> }
>
> + s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2));
> +
> return 0;
> }
>
> diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c
> index dc4cc65..75ef9e5 100644
> --- a/arch/arm/mach-s5p64x0/setup-i2c0.c
> +++ b/arch/arm/mach-s5p64x0/setup-i2c0.c
> @@ -25,17 +25,15 @@ struct platform_device; /* don't need the contents */
>
> void s5p6440_i2c0_cfg_gpio(struct platform_device *dev)
> {
> - s3c_gpio_cfgpin(S5P6440_GPB(5), S3C_GPIO_SFN(2));
> + s3c_gpio_cfgpin_range(S5P6440_GPB(5), 2, S3C_GPIO_SFN(2));
> s3c_gpio_setpull(S5P6440_GPB(5), S3C_GPIO_PULL_UP);
> - s3c_gpio_cfgpin(S5P6440_GPB(6), S3C_GPIO_SFN(2));
> s3c_gpio_setpull(S5P6440_GPB(6), S3C_GPIO_PULL_UP);
> }
>
> void s5p6450_i2c0_cfg_gpio(struct platform_device *dev)
> {
> - s3c_gpio_cfgpin(S5P6450_GPB(5), S3C_GPIO_SFN(2));
> + s3c_gpio_cfgpin_range(S5P6450_GPB(5), 2, S3C_GPIO_SFN(2));
> s3c_gpio_setpull(S5P6450_GPB(5), S3C_GPIO_PULL_UP);
> - s3c_gpio_cfgpin(S5P6450_GPB(6), S3C_GPIO_SFN(2));
> s3c_gpio_setpull(S5P6450_GPB(6), S3C_GPIO_PULL_UP);
> }
>
> diff --git a/arch/arm/mach-s5p64x0/setup-i2c1.c b/arch/arm/mach-s5p64x0/setup-i2c1.c
> index 2edd791..5d5dd3c 100644
> --- a/arch/arm/mach-s5p64x0/setup-i2c1.c
> +++ b/arch/arm/mach-s5p64x0/setup-i2c1.c
> @@ -25,17 +25,15 @@ struct platform_device; /* don't need the contents */
>
> void s5p6440_i2c1_cfg_gpio(struct platform_device *dev)
> {
> - s3c_gpio_cfgpin(S5P6440_GPR(9), S3C_GPIO_SFN(6));
> + s3c_gpio_cfgpin_range(S5P6440_GPR(9), 2, S3C_GPIO_SFN(6));
> s3c_gpio_setpull(S5P6440_GPR(9), S3C_GPIO_PULL_UP);
> - s3c_gpio_cfgpin(S5P6440_GPR(10), S3C_GPIO_SFN(6));
> s3c_gpio_setpull(S5P6440_GPR(10), S3C_GPIO_PULL_UP);
> }
>
> void s5p6450_i2c1_cfg_gpio(struct platform_device *dev)
> {
> - s3c_gpio_cfgpin(S5P6450_GPR(9), S3C_GPIO_SFN(6));
> + s3c_gpio_cfgpin_range(S5P6450_GPR(9), 2, S3C_GPIO_SFN(6));
> s3c_gpio_setpull(S5P6450_GPR(9), S3C_GPIO_PULL_UP);
> - s3c_gpio_cfgpin(S5P6450_GPR(10), S3C_GPIO_SFN(6));
> s3c_gpio_setpull(S5P6450_GPR(10), S3C_GPIO_PULL_UP);
> }
>
> --
> 1.6.2.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH 06/27] ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgpin_range()
2010-10-02 1:23 ` Kyungmin Park
@ 2010-10-02 11:16 ` Kukjin Kim
0 siblings, 0 replies; 30+ messages in thread
From: Kukjin Kim @ 2010-10-02 11:16 UTC (permalink / raw)
To: 'Kyungmin Park'; +Cc: linux-arm-kernel, linux-samsung-soc, ben-linux
Kyungmin Park wrote:
>
> Hi,
>
Hi :-)
> On Fri, Oct 1, 2010 at 9:05 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > This patch changes the code setting ranges of GPIO pins in mach-s5p64x0
using
> > s3c_gpio_cfgpin() to use the recently introduced
s3c_gpio_cfgpin_range().
> > NOTE: This is for missed things from the previous patch.
> >
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> > ---
> > arch/arm/mach-s5p64x0/dev-spi.c | 24 ++++++++++++------------
> > arch/arm/mach-s5p64x0/setup-i2c0.c | 6 ++----
> > arch/arm/mach-s5p64x0/setup-i2c1.c | 6 ++----
> > 3 files changed, 16 insertions(+), 20 deletions(-)
> >
> > diff --git a/arch/arm/mach-s5p64x0/dev-spi.c
b/arch/arm/mach-s5p64x0/dev-spi.c
> > index 5b69ec4..be64fee 100644
> > --- a/arch/arm/mach-s5p64x0/dev-spi.c
> > +++ b/arch/arm/mach-s5p64x0/dev-spi.c
> > @@ -39,20 +39,18 @@ static char *s5p64x0_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);
>
> Also make a wrapper, s3c_gpio_cfgrange_pullup, then you can also
> remove above codes.
> There's lots of codes use PULL_UP as default pin setup.
>
Thanks for your suggestion.
Ok..will consider it.
(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2010-10-02 11:16 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01 12:04 [PATCH 00/27] ARM: SAMSUNG: GPIO updates Kukjin Kim
2010-10-01 12:04 ` [PATCH 01/27] ARM: SAMSUNG: Add GPIO configuration for a range of pins Kukjin Kim
2010-10-01 12:04 ` [PATCH 02/27] ARM: S3C64XX: Change dev-audio.c to use S3C_GPIO_SFN() for special functions Kukjin Kim
2010-10-01 12:05 ` [PATCH 03/27] ARM: S3C64XX: Change to using s3c_gpio_cfgpin_range() Kukjin Kim
2010-10-01 12:05 ` [PATCH 04/27] ARM: S5P6442: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 05/27] ARM: S5P64X0: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 06/27] ARM: S5P64X0: 2nd " Kukjin Kim
2010-10-02 1:23 ` Kyungmin Park
2010-10-02 11:16 ` Kukjin Kim
2010-10-01 12:05 ` [PATCH 07/27] ARM: S5PC100: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 08/27] ARM: S5PV210: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 09/27] ARM: S5PV310: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 10/27] ARM: SAMSUNG: Add s3c_gpio_cfgall_range() function Kukjin Kim
2010-10-01 12:05 ` [PATCH 11/27] ARM: S3C64XX: Change to using s3c_gpio_cfgall_range() Kukjin Kim
2010-10-01 12:05 ` [PATCH 12/27] ARM: S5P6442: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 13/27] ARM: S5P64X0: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 14/27] ARM: S5PC100: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 15/27] ARM: S5PV210: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 16/27] ARM: S5PV310: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 17/27] ARM: S3C64XX: 2nd " Kukjin Kim
2010-10-01 12:05 ` [PATCH 18/27] ARM: S5P64X0: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 19/27] ARM: S5PC100: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 20/27] ARM: S5PV210: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 21/27] ARM: SAMSUNG: Add s3c_gpio_cfgrange_nopull() helper Kukjin Kim
2010-10-01 12:05 ` [PATCH 22/27] ARM: S3C64XX: Change to using s3c_gpio_cfgrange_nopull() Kukjin Kim
2010-10-01 12:05 ` [PATCH 23/27] ARM: S5PC100: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 24/27] ARM: S5PV210: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 25/27] ARM: S3C64XX: 2nd " Kukjin Kim
2010-10-01 12:05 ` [PATCH 26/27] ARM: S5PC100: " Kukjin Kim
2010-10-01 12:05 ` [PATCH 27/27] ARM: S5PV210: " Kukjin Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox