2007-02-12 00:31:01 +07:00
|
|
|
/* linux/arch/arm/mach-s3c2400/gpio.c
|
2006-02-02 04:24:23 +07: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-07 01:03:21 +07:00
|
|
|
*/
|
2006-02-02 04:24:23 +07:00
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/ioport.h>
|
2008-09-06 18:10:45 +07:00
|
|
|
#include <linux/io.h>
|
2006-02-02 04:24:23 +07:00
|
|
|
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/hardware.h>
|
2006-02-02 04:24:23 +07:00
|
|
|
#include <asm/irq.h>
|
|
|
|
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/regs-gpio.h>
|
2006-02-02 04:24:23 +07:00
|
|
|
|
|
|
|
int s3c2400_gpio_getirq(unsigned int pin)
|
|
|
|
{
|
2009-05-19 01:40:18 +07:00
|
|
|
if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE(7))
|
|
|
|
return -EINVAL; /* not valid interrupts */
|
2006-02-02 04:24:23 +07:00
|
|
|
|
2009-05-18 04:32:23 +07:00
|
|
|
return (pin - S3C2410_GPE(0)) + IRQ_EINT0;
|
2006-02-02 04:24:23 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
EXPORT_SYMBOL(s3c2400_gpio_getirq);
|