summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c24xx
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-01-28 13:01:23 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-28 13:20:51 +0000
commitbb6d9b56c1d5c1cbff39b7c337c900e2b3d8387a (patch)
tree7ceb92448f96f99f590f16a22b0e6cb66b9ff744 /arch/arm/plat-s3c24xx
parent9f613be4a9b6d680772b0a52a43a4a94d8e131b6 (diff)
downloadblackbird-op-linux-bb6d9b56c1d5c1cbff39b7c337c900e2b3d8387a.tar.gz
blackbird-op-linux-bb6d9b56c1d5c1cbff39b7c337c900e2b3d8387a.zip
[ARM] 4783/1: S3C24XX: Add s3c2410_gpio_getpull()
Add the call s3c2410_gpio_getpull() to return the current state of the pin's pull-up. 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/plat-s3c24xx')
-rw-r--r--arch/arm/plat-s3c24xx/gpio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c
index ec3a09c4d181..7cc6faec25d9 100644
--- a/arch/arm/plat-s3c24xx/gpio.c
+++ b/arch/arm/plat-s3c24xx/gpio.c
@@ -122,6 +122,19 @@ void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
EXPORT_SYMBOL(s3c2410_gpio_pullup);
+int s3c2410_gpio_getpull(unsigned int pin)
+{
+ void __iomem *base = S3C24XX_GPIO_BASE(pin);
+ unsigned long offs = S3C2410_GPIO_OFFSET(pin);
+
+ if (pin < S3C2410_GPIO_BANKB)
+ return -EINVAL;
+
+ return (__raw_readl(base + 0x08) & (1L << offs)) ? 1 : 0;
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_getpull);
+
void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
{
void __iomem *base = S3C24XX_GPIO_BASE(pin);
OpenPOWER on IntegriCloud