diff options
Diffstat (limited to 'arch/arm/mach-s3c2410/gpio.c')
-rw-r--r-- | arch/arm/mach-s3c2410/gpio.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c index d1740643a135..f6fb215bb48c 100644 --- a/arch/arm/mach-s3c2410/gpio.c +++ b/arch/arm/mach-s3c2410/gpio.c | |||
@@ -84,15 +84,18 @@ EXPORT_SYMBOL(s3c2410_gpio_cfgpin); | |||
84 | unsigned int s3c2410_gpio_getcfg(unsigned int pin) | 84 | unsigned int s3c2410_gpio_getcfg(unsigned int pin) |
85 | { | 85 | { |
86 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 86 | void __iomem *base = S3C24XX_GPIO_BASE(pin); |
87 | unsigned long mask; | 87 | unsigned long val = __raw_readl(base); |
88 | 88 | ||
89 | if (pin < S3C2410_GPIO_BANKB) { | 89 | if (pin < S3C2410_GPIO_BANKB) { |
90 | mask = 1 << S3C2410_GPIO_OFFSET(pin); | 90 | val >>= S3C2410_GPIO_OFFSET(pin); |
91 | val &= 1; | ||
92 | val += 1; | ||
91 | } else { | 93 | } else { |
92 | mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; | 94 | val >>= S3C2410_GPIO_OFFSET(pin)*2; |
95 | val &= 3; | ||
93 | } | 96 | } |
94 | 97 | ||
95 | return __raw_readl(base) & mask; | 98 | return val | S3C2410_GPIO_INPUT; |
96 | } | 99 | } |
97 | 100 | ||
98 | EXPORT_SYMBOL(s3c2410_gpio_getcfg); | 101 | EXPORT_SYMBOL(s3c2410_gpio_getcfg); |