diff options
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 4a899c279eb5..95df059b5a1d 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c | |||
@@ -183,35 +183,19 @@ EXPORT_SYMBOL(s3c2410_modify_misccr); | |||
183 | 183 | ||
184 | int s3c2410_gpio_getirq(unsigned int pin) | 184 | int s3c2410_gpio_getirq(unsigned int pin) |
185 | { | 185 | { |
186 | if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15) | 186 | if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) |
187 | return -1; /* not valid interrupts */ | 187 | return -EINVAL; /* not valid interrupts */ |
188 | 188 | ||
189 | if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7) | 189 | if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) |
190 | return -1; /* not valid pin */ | 190 | return -EINVAL; /* not valid pin */ |
191 | 191 | ||
192 | if (pin < S3C2410_GPF4) | 192 | if (pin < S3C2410_GPF(4)) |
193 | return (pin - S3C2410_GPF0) + IRQ_EINT0; | 193 | return (pin - S3C2410_GPF(0)) + IRQ_EINT0; |
194 | 194 | ||
195 | if (pin < S3C2410_GPG0) | 195 | if (pin < S3C2410_GPG(0)) |
196 | return (pin - S3C2410_GPF4) + IRQ_EINT4; | 196 | return (pin - S3C2410_GPF(4)) + IRQ_EINT4; |
197 | 197 | ||
198 | return (pin - S3C2410_GPG0) + IRQ_EINT8; | 198 | return (pin - S3C2410_GPG(0)) + IRQ_EINT8; |
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); | ||