2007-02-11 18:31:01 +01:00
/* linux/arch/arm/mach-s3c2400/gpio.c
2006-02-01 21:24:23 +00:00
*
* Copyright ( c ) 2006 Lucas Correia Villa Real < lucasvr @ gobolinux . org >
*
* S3C2400 GPIO support
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
2006-09-06 19:03:21 +01:00
*/
2006-02-01 21:24:23 +00:00
# include <linux/kernel.h>
# include <linux/init.h>
# include <linux/module.h>
# include <linux/interrupt.h>
# include <linux/ioport.h>
2008-09-06 12:10:45 +01:00
# include <linux/io.h>
2006-02-01 21:24:23 +00:00
2008-08-05 16:14:15 +01:00
# include <mach/hardware.h>
2006-02-01 21:24:23 +00:00
# include <asm/irq.h>
2008-08-05 16:14:15 +01:00
# include <mach/regs-gpio.h>
2006-02-01 21:24:23 +00:00
int s3c2400_gpio_getirq ( unsigned int pin )
{
2009-05-18 19:40:18 +01:00
if ( pin < S3C2410_GPE ( 0 ) | | pin > S3C2400_GPE ( 7 ) )
return - EINVAL ; /* not valid interrupts */
2006-02-01 21:24:23 +00:00
2009-05-17 22:32:23 +01:00
return ( pin - S3C2410_GPE ( 0 ) ) + IRQ_EINT0 ;
2006-02-01 21:24:23 +00:00
}
EXPORT_SYMBOL ( s3c2400_gpio_getirq ) ;