diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-04-30 06:30:35 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-05 20:25:50 -0400 |
commit | 9bbb851c7079ff670ba3fe6c7ce93bb5daa9a694 (patch) | |
tree | 0b6ddca771a718fb52084317208b2a111ad3b8d6 /arch/arm/plat-s3c24xx/gpiolib.c | |
parent | 7ebd467551ed6ae200d7835a84bbda0dcadaa511 (diff) |
ARM: S3C24XX: Add initial s3c_gpio configuration code
Add support for s3c_gpio_setcfg() and s3c_gpio_setpull() implementations
to get ready for removal of the specific code being used by s3c24xx.
Also rename the s3c_gpio_setcfg_s3c24xx_banka to s3c_gpio_setcfg_s3c24xx_a
as seen in the header file to correct a build warning.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c24xx/gpiolib.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/gpiolib.c | 17 |
1 files changed, 16 insertions, 1 deletions
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 | ||
82 | static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = { | ||
83 | .set_config = s3c_gpio_setcfg_s3c24xx_a, | ||
84 | }; | ||
85 | |||
86 | struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { | ||
87 | .set_config = s3c_gpio_setcfg_s3c24xx, | ||
88 | }; | ||
89 | |||
80 | struct s3c_gpio_chip s3c24xx_gpios[] = { | 90 | struct 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 | } |