linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/5] ARM: S5PC110: gpio_to_irq support on external interrupt
@ 2010-08-05  7:25 Kyungmin Park
  2010-08-17  5:51 ` Kyungmin Park
  0 siblings, 1 reply; 2+ messages in thread
From: Kyungmin Park @ 2010-08-05  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kyungmin Park <kyungmin.park@samsung.com>

Using group field, it can calculate the related irq number easily.
Also if don't support gpio_to_irq, it can't use the gpio functionaliy fully.
e.g., can't use the gpio-keys and so on

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/mach-s5pv210/gpiolib.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/gpiolib.c b/arch/arm/mach-s5pv210/gpiolib.c
index f6a32c4..bd24c81 100644
--- a/arch/arm/mach-s5pv210/gpiolib.c
+++ b/arch/arm/mach-s5pv210/gpiolib.c
@@ -246,6 +246,15 @@ static struct s3c_gpio_chip s5pv210_gpio_4bit[] = {
 	},
 };
 
+static int s5pv210_extint_to_irq(struct gpio_chip *gpio, unsigned int offset)
+{
+	struct s3c_gpio_chip *chip = to_s3c_gpio(gpio);
+	int irq;
+
+	irq = (chip->group * 8) + offset;
+	return IRQ_EINT(irq);
+}
+
 static __init int s5pv210_gpiolib_init(void)
 {
 	struct s3c_gpio_chip *chip = s5pv210_gpio_4bit;
@@ -257,6 +266,9 @@ static __init int s5pv210_gpiolib_init(void)
 			chip->config = &gpio_cfg;
 		if (chip->config == &gpio_cfg_extint) {
 			chip->base = S5PV210_BANK_BASE(extint) + EXTINT_OFFSET;
+			/* Assign the external GPIO interrupt group number */
+			chip->group = extint;
+			chip->chip.to_irq = s5pv210_extint_to_irq;
 			extint++;
 		}
 		if (chip->base == NULL)
-- 
1.5.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 3/5] ARM: S5PC110: gpio_to_irq support on external interrupt
  2010-08-05  7:25 [PATCH 3/5] ARM: S5PC110: gpio_to_irq support on external interrupt Kyungmin Park
@ 2010-08-17  5:51 ` Kyungmin Park
  0 siblings, 0 replies; 2+ messages in thread
From: Kyungmin Park @ 2010-08-17  5:51 UTC (permalink / raw)
  To: linux-arm-kernel

I think it's also bug fix since current external IRQ can't support
'gpio_to_irq' feature.
I hope it's included at this rc window.

On Thu, Aug 5, 2010 at 4:25 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> From: Kyungmin Park <kyungmin.park@samsung.com>
>
> Using group field, it can calculate the related irq number easily.
> Also if don't support gpio_to_irq, it can't use the gpio functionaliy fully.
> e.g., can't use the gpio-keys and so on
>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> ?arch/arm/mach-s5pv210/gpiolib.c | ? 12 ++++++++++++
> ?1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-s5pv210/gpiolib.c b/arch/arm/mach-s5pv210/gpiolib.c
> index f6a32c4..bd24c81 100644
> --- a/arch/arm/mach-s5pv210/gpiolib.c
> +++ b/arch/arm/mach-s5pv210/gpiolib.c
> @@ -246,6 +246,15 @@ static struct s3c_gpio_chip s5pv210_gpio_4bit[] = {
> ? ? ? ?},
> ?};
>
> +static int s5pv210_extint_to_irq(struct gpio_chip *gpio, unsigned int offset)
> +{
> + ? ? ? struct s3c_gpio_chip *chip = to_s3c_gpio(gpio);
> + ? ? ? int irq;
> +
> + ? ? ? irq = (chip->group * 8) + offset;
> + ? ? ? return IRQ_EINT(irq);
> +}
> +
> ?static __init int s5pv210_gpiolib_init(void)
> ?{
> ? ? ? ?struct s3c_gpio_chip *chip = s5pv210_gpio_4bit;
> @@ -257,6 +266,9 @@ static __init int s5pv210_gpiolib_init(void)
> ? ? ? ? ? ? ? ? ? ? ? ?chip->config = &gpio_cfg;
> ? ? ? ? ? ? ? ?if (chip->config == &gpio_cfg_extint) {
> ? ? ? ? ? ? ? ? ? ? ? ?chip->base = S5PV210_BANK_BASE(extint) + EXTINT_OFFSET;
> + ? ? ? ? ? ? ? ? ? ? ? /* Assign the external GPIO interrupt group number */
> + ? ? ? ? ? ? ? ? ? ? ? chip->group = extint;
> + ? ? ? ? ? ? ? ? ? ? ? chip->chip.to_irq = s5pv210_extint_to_irq;
> ? ? ? ? ? ? ? ? ? ? ? ?extint++;
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ? ?if (chip->base == NULL)
> --
> 1.5.3.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-17  5:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05  7:25 [PATCH 3/5] ARM: S5PC110: gpio_to_irq support on external interrupt Kyungmin Park
2010-08-17  5:51 ` Kyungmin Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).