diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-06-10 22:40:55 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-06-10 22:41:06 +0100 |
commit | 547c32aeb5a24178ef20488ae0508efcc32ae8e4 (patch) | |
tree | fdc33154820cfddc845cef2f67380dace655b28f /arch/arm/plat-s3c24xx/gpio.c | |
parent | b0efb42478c81ed0ed9aa0dc444db200c32624f0 (diff) | |
parent | 99ae99533a059750c4b0f76295625b8ac5ea751a (diff) |
Merge branch for-rmk-devel of git://aeryn.fluff.org.uk/bjdooks/linux into devel
Diffstat (limited to 'arch/arm/plat-s3c24xx/gpio.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/gpio.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 4a899c279eb..95df059b5a1 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c @@ -183,35 +183,19 @@ EXPORT_SYMBOL(s3c2410_modify_misccr); int s3c2410_gpio_getirq(unsigned int pin) { - if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15) - return -1; /* not valid interrupts */ + if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) + return -EINVAL; /* not valid interrupts */ - if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7) - return -1; /* not valid pin */ + if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) + return -EINVAL; /* not valid pin */ - if (pin < S3C2410_GPF4) - return (pin - S3C2410_GPF0) + IRQ_EINT0; + if (pin < S3C2410_GPF(4)) + return (pin - S3C2410_GPF(0)) + IRQ_EINT0; - if (pin < S3C2410_GPG0) - return (pin - S3C2410_GPF4) + IRQ_EINT4; + if (pin < S3C2410_GPG(0)) + return (pin - S3C2410_GPF(4)) + IRQ_EINT4; - return (pin - S3C2410_GPG0) + IRQ_EINT8; + return (pin - S3C2410_GPG(0)) + IRQ_EINT8; } EXPORT_SYMBOL(s3c2410_gpio_getirq); - -int s3c2410_gpio_irq2pin(unsigned int irq) -{ - if (irq >= IRQ_EINT0 && irq <= IRQ_EINT3) - return S3C2410_GPF0 + (irq - IRQ_EINT0); - - if (irq >= IRQ_EINT4 && irq <= IRQ_EINT7) - return S3C2410_GPF4 + (irq - IRQ_EINT4); - - if (irq >= IRQ_EINT8 && irq <= IRQ_EINT23) - return S3C2410_GPG0 + (irq - IRQ_EINT8); - - return -EINVAL; -} - -EXPORT_SYMBOL(s3c2410_gpio_irq2pin); |