diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-01-28 07:01:33 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-28 08:20:52 -0500 |
commit | c27cb681ac1598352569f75cb19850a12b7ef102 (patch) | |
tree | 16e88e3069e1727726f0bb3ce99659d5aa38bbca /arch/arm/plat-s3c24xx/gpio.c | |
parent | 9b8c0088404778a1291191cf140bcfea082f027c (diff) |
[ARM] 4793/1: S3C24XX: Add IRQ->GPIO pin mapping function
Add the reverse of s3c2410_gpio_getirq to convert
a IRQ number into a GPIO pin number.
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/gpio.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/gpio.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 7cc6faec25d9..ee99dcc7f0bd 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c | |||
@@ -199,3 +199,19 @@ int s3c2410_gpio_getirq(unsigned int pin) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | EXPORT_SYMBOL(s3c2410_gpio_getirq); | 201 | EXPORT_SYMBOL(s3c2410_gpio_getirq); |
202 | |||
203 | int s3c2410_gpio_irq2pin(unsigned int irq) | ||
204 | { | ||
205 | if (irq >= IRQ_EINT0 && irq <= IRQ_EINT3) | ||
206 | return S3C2410_GPF0 + (irq - IRQ_EINT0); | ||
207 | |||
208 | if (irq >= IRQ_EINT4 && irq <= IRQ_EINT7) | ||
209 | return S3C2410_GPF4 + (irq - IRQ_EINT4); | ||
210 | |||
211 | if (irq >= IRQ_EINT8 && irq <= IRQ_EINT23) | ||
212 | return S3C2410_GPG0 + (irq - IRQ_EINT8); | ||
213 | |||
214 | return -EINVAL; | ||
215 | } | ||
216 | |||
217 | EXPORT_SYMBOL(s3c2410_gpio_irq2pin); | ||