diff options
| author | Ben Dooks <ben-linux@fluff.org> | 2008-01-28 07:01:23 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-28 08:20:51 -0500 |
| commit | bb6d9b56c1d5c1cbff39b7c337c900e2b3d8387a (patch) | |
| tree | 7ceb92448f96f99f590f16a22b0e6cb66b9ff744 | |
| parent | 9f613be4a9b6d680772b0a52a43a4a94d8e131b6 (diff) | |
[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>
| -rw-r--r-- | arch/arm/plat-s3c24xx/gpio.c | 13 | ||||
| -rw-r--r-- | include/asm-arm/arch-s3c2410/hardware.h | 12 |
2 files changed, 25 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) | |||
| 122 | 122 | ||
| 123 | EXPORT_SYMBOL(s3c2410_gpio_pullup); | 123 | EXPORT_SYMBOL(s3c2410_gpio_pullup); |
| 124 | 124 | ||
| 125 | int s3c2410_gpio_getpull(unsigned int pin) | ||
| 126 | { | ||
| 127 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
| 128 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
| 129 | |||
| 130 | if (pin < S3C2410_GPIO_BANKB) | ||
| 131 | return -EINVAL; | ||
| 132 | |||
| 133 | return (__raw_readl(base + 0x08) & (1L << offs)) ? 1 : 0; | ||
| 134 | } | ||
| 135 | |||
| 136 | EXPORT_SYMBOL(s3c2410_gpio_getpull); | ||
| 137 | |||
| 125 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) | 138 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) |
| 126 | { | 139 | { |
| 127 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 140 | void __iomem *base = S3C24XX_GPIO_BASE(pin); |
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h index faeaba514ffe..20509e4540f6 100644 --- a/include/asm-arm/arch-s3c2410/hardware.h +++ b/include/asm-arm/arch-s3c2410/hardware.h | |||
| @@ -87,6 +87,18 @@ extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, | |||
| 87 | 87 | ||
| 88 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); | 88 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); |
| 89 | 89 | ||
| 90 | /* s3c2410_gpio_getpull | ||
| 91 | * | ||
| 92 | * Read the state of the pull-up on a given pin | ||
| 93 | * | ||
| 94 | * return: | ||
| 95 | * < 0 => error code | ||
| 96 | * 0 => enabled | ||
| 97 | * 1 => disabled | ||
| 98 | */ | ||
| 99 | |||
| 100 | extern int s3c2410_gpio_getpull(unsigned int pin); | ||
| 101 | |||
| 90 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); | 102 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); |
| 91 | 103 | ||
| 92 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); | 104 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); |
