diff options
author | Ben Dooks <ben-linux@fluff.org> | 2007-01-16 06:56:58 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-01-24 06:59:56 -0500 |
commit | 30f0e0f4153918a22d802b415980974514139389 (patch) | |
tree | 9b7867e04c29977fbfffffb0a43e98350a458e09 /arch/arm/mach-s3c2410/gpio.c | |
parent | 6c3c5bb3c68b932ece9f92b9d201196d537cb99c (diff) |
[ARM] 4096/1: S3C24XX: change return code form s3c2410_gpio_getcfg()
The s3c2410_gpio_getcfg() currently returns
a value which is dependant on the GPIO no
passed in. Now we have more generic constants
it is sensible to use those as return codes
so that any function dealing with >1 GPIO
does not need to do it's own number processing.
Since this function is only currently used in
pm.c, it is easy to fixup (and correct pm.c
to use the generic constants)
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
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); |