aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig1
-rw-r--r--arch/arm/plat-s3c24xx/gpiolib.c17
-rw-r--r--arch/arm/plat-samsung/gpio-config.c4
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-core.h3
4 files changed, 22 insertions, 3 deletions
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 6e93ef8f3d43..a830fad6f89e 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -9,6 +9,7 @@ config PLAT_S3C24XX
9 select NO_IOPORT 9 select NO_IOPORT
10 select ARCH_REQUIRE_GPIOLIB 10 select ARCH_REQUIRE_GPIOLIB
11 select S3C_DEVICE_NAND 11 select S3C_DEVICE_NAND
12 select S3C_GPIO_CFG_S3C24XX
12 help 13 help
13 Base platform code for any Samsung S3C24XX device 14 Base platform code for any Samsung S3C24XX device
14 15
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index 4f0f11a6a677..376b061804c2 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -21,6 +21,8 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22 22
23#include <plat/gpio-core.h> 23#include <plat/gpio-core.h>
24#include <plat/gpio-cfg.h>
25#include <plat/gpio-cfg-helpers.h>
24#include <mach/hardware.h> 26#include <mach/hardware.h>
25#include <asm/irq.h> 27#include <asm/irq.h>
26#include <plat/pm.h> 28#include <plat/pm.h>
@@ -77,10 +79,19 @@ static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset)
77 return IRQ_EINT8 + offset; 79 return IRQ_EINT8 + offset;
78} 80}
79 81
82static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = {
83 .set_config = s3c_gpio_setcfg_s3c24xx_a,
84};
85
86struct s3c_gpio_cfg s3c24xx_gpiocfg_default = {
87 .set_config = s3c_gpio_setcfg_s3c24xx,
88};
89
80struct s3c_gpio_chip s3c24xx_gpios[] = { 90struct s3c_gpio_chip s3c24xx_gpios[] = {
81 [0] = { 91 [0] = {
82 .base = S3C2410_GPACON, 92 .base = S3C2410_GPACON,
83 .pm = __gpio_pm(&s3c_gpio_pm_1bit), 93 .pm = __gpio_pm(&s3c_gpio_pm_1bit),
94 .config = &s3c24xx_gpiocfg_banka,
84 .chip = { 95 .chip = {
85 .base = S3C2410_GPA(0), 96 .base = S3C2410_GPA(0),
86 .owner = THIS_MODULE, 97 .owner = THIS_MODULE,
@@ -168,8 +179,12 @@ static __init int s3c24xx_gpiolib_init(void)
168 struct s3c_gpio_chip *chip = s3c24xx_gpios; 179 struct s3c_gpio_chip *chip = s3c24xx_gpios;
169 int gpn; 180 int gpn;
170 181
171 for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) 182 for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) {
183 if (!chip->config)
184 chip->config = &s3c24xx_gpiocfg_default;
185
172 s3c_gpiolib_add(chip); 186 s3c_gpiolib_add(chip);
187 }
173 188
174 return 0; 189 return 0;
175} 190}
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index 44a84e896546..c5832824e198 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -61,8 +61,8 @@ int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull)
61EXPORT_SYMBOL(s3c_gpio_setpull); 61EXPORT_SYMBOL(s3c_gpio_setpull);
62 62
63#ifdef CONFIG_S3C_GPIO_CFG_S3C24XX 63#ifdef CONFIG_S3C_GPIO_CFG_S3C24XX
64int s3c_gpio_setcfg_s3c24xx_banka(struct s3c_gpio_chip *chip, 64int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
65 unsigned int off, unsigned int cfg) 65 unsigned int off, unsigned int cfg)
66{ 66{
67 void __iomem *reg = chip->base; 67 void __iomem *reg = chip->base;
68 unsigned int shift = off; 68 unsigned int shift = off;
diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h
index 49ff406a7066..f0584f26d493 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-core.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
@@ -108,6 +108,9 @@ extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip,
108extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); 108extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip);
109extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip); 109extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
110 110
111/* exported for core SoC support to change */
112extern struct s3c_gpio_cfg s3c24xx_gpiocfg_default;
113
111#ifdef CONFIG_S3C_GPIO_TRACK 114#ifdef CONFIG_S3C_GPIO_TRACK
112extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; 115extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
113 116