Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: jy0922.shim@samsung.com (Joonyoung Shim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] ARM: S5P: Add GPIOlib gpio_to_irq for external interrupts
Date: Thu, 03 Jun 2010 15:14:53 +0900	[thread overview]
Message-ID: <4C07485D.2020808@samsung.com> (raw)
In-Reply-To: <20100603054323.GZ4720@trinity.fluff.org>

On 6/3/2010 2:43 PM, Ben Dooks wrote:
> On Thu, Jun 03, 2010 at 02:01:34PM +0900, Joonyoung Shim wrote:
>> This patch is to support gpio_to_irq() of GPIOlib for external
>> interrupts. The gpio_to_irq() calls s5p_gpiolib_eint_to_irq function.
> 
> How about each s3c_gpio_chip have a irq base in it?
>  

Good, then it can be arch and irq type(gpio, external)independent codes.

>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  arch/arm/plat-s5p/Makefile                     |    1 +
>>  arch/arm/plat-s5p/gpiolib.c                    |   35 ++++++++++++++++++++++++
>>  arch/arm/plat-samsung/include/plat/gpio-core.h |    2 +
>>  3 files changed, 38 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm/plat-s5p/gpiolib.c
>>
>> diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
>> index 39c242b..f6e1a13 100644
>> --- a/arch/arm/plat-s5p/Makefile
>> +++ b/arch/arm/plat-s5p/Makefile
>> @@ -15,6 +15,7 @@ obj-				:=
>>  obj-y				+= dev-uart.o
>>  obj-y				+= cpu.o
>>  obj-y				+= clock.o
>> +obj-y				+= gpiolib.o
>>  obj-y				+= irq.o
>>  obj-$(CONFIG_S5P_EXT_INT)	+= irq-eint.o
>>  
>> diff --git a/arch/arm/plat-s5p/gpiolib.c b/arch/arm/plat-s5p/gpiolib.c
>> new file mode 100644
>> index 0000000..0c27a9d
>> --- /dev/null
>> +++ b/arch/arm/plat-s5p/gpiolib.c
>> @@ -0,0 +1,35 @@
>> +/*
>> + * linux/arch/arm/plat-s5p/gpiolib.c
>> + *
>> + * Copyright (C) 2010 Samsung Electronics Co.Ltd
>> + * Author: Joonyoung Shim <jy0922.shim@samsung.com>
>> + *
>> + * S5P - GPIOlib 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.
>> + *
>> + */
>> +
>> +#include <linux/gpio.h>
>> +#include <mach/irqs.h>
>> +#include <mach/regs-gpio.h>
>> +
>> +/* be called from gpio_to_irq() for external interrupts */
>> +int s5p_gpiolib_eint_to_irq(struct gpio_chip *chip, unsigned int offset)
>> +{
>> +	switch (chip->base) {
>> +	case EINT_GPIO_0(0):
>> +		return IRQ_EINT(offset);
>> +	case EINT_GPIO_1(0):
>> +		return IRQ_EINT(8 + offset);
>> +	case EINT_GPIO_2(0):
>> +		return IRQ_EINT(16 + offset);
>> +	case EINT_GPIO_3(0):
>> +		return IRQ_EINT(24 + offset);
>> +	default:
>> +		return -EINVAL;
>> +	}
>> +}
>> diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h
>> index e358c7d..f6c5151 100644
>> --- a/arch/arm/plat-samsung/include/plat/gpio-core.h
>> +++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
>> @@ -121,6 +121,8 @@ extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
>>  /* exported for core SoC support to change */
>>  extern struct s3c_gpio_cfg s3c24xx_gpiocfg_default;
>>  
>> +extern int s5p_gpiolib_eint_to_irq(struct gpio_chip *chip, unsigned int offset);
>> +
>>  #ifdef CONFIG_S3C_GPIO_TRACK
>>  extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
>>  
>> -- 
>> 1.7.0.4
>>
> 

  reply	other threads:[~2010-06-03  6:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03  5:01 [PATCH 1/7] ARM: S5PC100: Move external interrupt defines Joonyoung Shim
2010-06-03  5:01 ` [PATCH 2/7] ARM: S5P: Add GPIOlib gpio_to_irq for external interrupts Joonyoung Shim
2010-06-03  5:43   ` Ben Dooks
2010-06-03  6:14     ` Joonyoung Shim [this message]
2010-06-03  5:01 ` [PATCH 3/7] ARM: S5PV210: Support " Joonyoung Shim
2010-06-03  5:01 ` [PATCH 4/7] ARM: S5PC100: Use S5P GPIOlib gpio_to_irq function " Joonyoung Shim
2010-06-03  5:01 ` [PATCH 5/7] ARM: S5PV210: Add gpio interrupt support Joonyoung Shim
2010-06-03  5:01 ` [PATCH 6/7] ARM: S5PC100: Use S5P gpio interrupts interface Joonyoung Shim
2010-06-03  5:01 ` [PATCH 7/7] ARM: S5P: Add GPIOlib gpio_to_irq for gpio interrupts Joonyoung Shim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C07485D.2020808@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox