linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] ARM: pxa: add irq ack for gpio irq
  2011-09-09  4:18 ` [PATCH 3/4] ARM: pxa: add irq ack for gpio irq Chao Xie
@ 2011-09-09  3:22   ` Eric Miao
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Miao @ 2011-09-09  3:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 8, 2011 at 9:18 PM, Chao Xie <chao.xie@marvell.com> wrote:
> For previous pxa3xx and pxa168, pxa9xx, the interrupt controller does
> not need any ack for the interrupt.
> For next ARM V7 SMP core, it will use GIC, and it need ack for the
> interrupt.
>
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
> ---
> ?arch/arm/plat-pxa/gpio.c | ? ?4 ++++
> ?1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
> index 15de09d..66ae80a 100644
> --- a/arch/arm/plat-pxa/gpio.c
> +++ b/arch/arm/plat-pxa/gpio.c
> @@ -19,6 +19,7 @@
> ?#include <linux/slab.h>
>
> ?#include <mach/gpio.h>
> +#include <asm/mach/irq.h>
>
> ?int pxa_last_gpio;
>
> @@ -206,7 +207,9 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
> ? ? ? ?struct pxa_gpio_chip *c;
> ? ? ? ?int loop, gpio, gpio_base, n;
> ? ? ? ?unsigned long gedr;
> + ? ? ? struct irq_chip *chip = irq_get_chip(irq);
>
> + ? ? ? chained_irq_enter(chip, desc);
> ? ? ? ?do {
> ? ? ? ? ? ? ? ?loop = 0;
> ? ? ? ? ? ? ? ?for_each_gpio_chip(gpio, c) {
> @@ -225,6 +228,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
> ? ? ? ? ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ? ?}
> ? ? ? ?} while (loop);
> + ? ? ? chained_irq_exit(chip, desc);
> ?}
>
> ?static void pxa_ack_muxed_gpio(struct irq_data *d)

Looks good to me.

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

* [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip
  2011-09-09  4:18 [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip Chao Xie
@ 2011-09-09  3:28 ` Eric Miao
  2011-09-09  5:30   ` Chao Xie
  2011-09-09  4:18 ` [PATCH 2/4] ARM: mmp: add irq_disable callback for icu chip Chao Xie
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Eric Miao @ 2011-09-09  3:28 UTC (permalink / raw)
  To: linux-arm-kernel

Chao,

I actually don't see why do we need irq_disable() here?

On Thu, Sep 8, 2011 at 9:18 PM, Chao Xie <chao.xie@marvell.com> wrote:
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
> ---
> ?arch/arm/plat-pxa/gpio.c | ? ?1 +
> ?1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
> index a11dc36..15de09d 100644
> --- a/arch/arm/plat-pxa/gpio.c
> +++ b/arch/arm/plat-pxa/gpio.c
> @@ -263,6 +263,7 @@ static struct irq_chip pxa_muxed_gpio_chip = {
> ? ? ? ?.irq_ack ? ? ? ?= pxa_ack_muxed_gpio,
> ? ? ? ?.irq_mask ? ? ? = pxa_mask_muxed_gpio,
> ? ? ? ?.irq_unmask ? ? = pxa_unmask_muxed_gpio,
> + ? ? ? .irq_disable ? ?= pxa_mask_muxed_gpio,
> ? ? ? ?.irq_set_type ? = pxa_gpio_irq_type,
> ?};
>
> --
> 1.7.0.4
>
>

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

* [PATCH 4/4] ARM: pxa: update gpio number to 192
  2011-09-09  4:18 ` [PATCH 4/4] ARM: pxa: update gpio number to 192 Chao Xie
@ 2011-09-09  3:28   ` Eric Miao
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Miao @ 2011-09-09  3:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 8, 2011 at 9:18 PM, Chao Xie <chao.xie@marvell.com> wrote:
> From: Haojian Zhuang <haojian.zhuang@marvell.com>
>
> 192 GPIO pins are supported in pxa95x.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> Signed-off-by: Chao Xie <chao.xie@marvell.com>

OK.

> ---
> ?arch/arm/mach-pxa/pxa95x.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c
> index 0ee166b..83ecc41 100644
> --- a/arch/arm/mach-pxa/pxa95x.c
> +++ b/arch/arm/mach-pxa/pxa95x.c
> @@ -236,7 +236,7 @@ static struct clk_lookup pxa95x_clkregs[] = {
> ?void __init pxa95x_init_irq(void)
> ?{
> ? ? ? ?pxa_init_irq(96, NULL);
> - ? ? ? pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
> + ? ? ? pxa_init_gpio(IRQ_GPIO_2_x, 2, 191, NULL);
> ?}
>
> ?/*
> --
> 1.7.0.4
>
>

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

* [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip
@ 2011-09-09  4:18 Chao Xie
  2011-09-09  3:28 ` Eric Miao
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Chao Xie @ 2011-09-09  4:18 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Chao Xie <chao.xie@marvell.com>
---
 arch/arm/plat-pxa/gpio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
index a11dc36..15de09d 100644
--- a/arch/arm/plat-pxa/gpio.c
+++ b/arch/arm/plat-pxa/gpio.c
@@ -263,6 +263,7 @@ static struct irq_chip pxa_muxed_gpio_chip = {
 	.irq_ack	= pxa_ack_muxed_gpio,
 	.irq_mask	= pxa_mask_muxed_gpio,
 	.irq_unmask	= pxa_unmask_muxed_gpio,
+	.irq_disable	= pxa_mask_muxed_gpio,
 	.irq_set_type	= pxa_gpio_irq_type,
 };
 
-- 
1.7.0.4

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

* [PATCH 2/4] ARM: mmp: add irq_disable callback for icu chip
  2011-09-09  4:18 [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip Chao Xie
  2011-09-09  3:28 ` Eric Miao
@ 2011-09-09  4:18 ` Chao Xie
  2011-09-09  4:18 ` [PATCH 3/4] ARM: pxa: add irq ack for gpio irq Chao Xie
  2011-09-09  4:18 ` [PATCH 4/4] ARM: pxa: update gpio number to 192 Chao Xie
  3 siblings, 0 replies; 8+ messages in thread
From: Chao Xie @ 2011-09-09  4:18 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Chao Xie <chao.xie@marvell.com>
---
 arch/arm/mach-mmp/irq-mmp2.c   |    2 ++
 arch/arm/mach-mmp/irq-pxa168.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mmp/irq-mmp2.c b/arch/arm/mach-mmp/irq-mmp2.c
index d21c544..36530be 100644
--- a/arch/arm/mach-mmp/irq-mmp2.c
+++ b/arch/arm/mach-mmp/irq-mmp2.c
@@ -41,6 +41,7 @@ static struct irq_chip icu_irq_chip = {
 	.irq_mask	= icu_mask_irq,
 	.irq_mask_ack	= icu_mask_irq,
 	.irq_unmask	= icu_unmask_irq,
+	.irq_disable	= icu_mask_irq,
 };
 
 static void pmic_irq_ack(struct irq_data *d)
@@ -90,6 +91,7 @@ static struct irq_chip _name_##_irq_chip = {				\
 	.name		= #_name_,					\
 	.irq_mask	= _name_##_mask_irq,				\
 	.irq_unmask	= _name_##_unmask_irq,				\
+	.irq_disable	= _name_##_mask_irq,				\
 }
 
 SECOND_IRQ_CHIP(pmic, IRQ_MMP2_PMIC_BASE, MMP2_ICU_INT4);
diff --git a/arch/arm/mach-mmp/irq-pxa168.c b/arch/arm/mach-mmp/irq-pxa168.c
index 89706a0..7185157 100644
--- a/arch/arm/mach-mmp/irq-pxa168.c
+++ b/arch/arm/mach-mmp/irq-pxa168.c
@@ -40,6 +40,7 @@ static struct irq_chip icu_irq_chip = {
 	.irq_ack	= icu_mask_irq,
 	.irq_mask	= icu_mask_irq,
 	.irq_unmask	= icu_unmask_irq,
+	.irq_disable	= icu_mask_irq,
 };
 
 void __init icu_init_irq(void)
-- 
1.7.0.4

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

* [PATCH 3/4] ARM: pxa: add irq ack for gpio irq
  2011-09-09  4:18 [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip Chao Xie
  2011-09-09  3:28 ` Eric Miao
  2011-09-09  4:18 ` [PATCH 2/4] ARM: mmp: add irq_disable callback for icu chip Chao Xie
@ 2011-09-09  4:18 ` Chao Xie
  2011-09-09  3:22   ` Eric Miao
  2011-09-09  4:18 ` [PATCH 4/4] ARM: pxa: update gpio number to 192 Chao Xie
  3 siblings, 1 reply; 8+ messages in thread
From: Chao Xie @ 2011-09-09  4:18 UTC (permalink / raw)
  To: linux-arm-kernel

For previous pxa3xx and pxa168, pxa9xx, the interrupt controller does
not need any ack for the interrupt.
For next ARM V7 SMP core, it will use GIC, and it need ack for the
interrupt.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
---
 arch/arm/plat-pxa/gpio.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
index 15de09d..66ae80a 100644
--- a/arch/arm/plat-pxa/gpio.c
+++ b/arch/arm/plat-pxa/gpio.c
@@ -19,6 +19,7 @@
 #include <linux/slab.h>
 
 #include <mach/gpio.h>
+#include <asm/mach/irq.h>
 
 int pxa_last_gpio;
 
@@ -206,7 +207,9 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
 	struct pxa_gpio_chip *c;
 	int loop, gpio, gpio_base, n;
 	unsigned long gedr;
+	struct irq_chip *chip = irq_get_chip(irq);
 
+	chained_irq_enter(chip, desc);
 	do {
 		loop = 0;
 		for_each_gpio_chip(gpio, c) {
@@ -225,6 +228,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
 			}
 		}
 	} while (loop);
+	chained_irq_exit(chip, desc);
 }
 
 static void pxa_ack_muxed_gpio(struct irq_data *d)
-- 
1.7.0.4

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

* [PATCH 4/4] ARM: pxa: update gpio number to 192
  2011-09-09  4:18 [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip Chao Xie
                   ` (2 preceding siblings ...)
  2011-09-09  4:18 ` [PATCH 3/4] ARM: pxa: add irq ack for gpio irq Chao Xie
@ 2011-09-09  4:18 ` Chao Xie
  2011-09-09  3:28   ` Eric Miao
  3 siblings, 1 reply; 8+ messages in thread
From: Chao Xie @ 2011-09-09  4:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Haojian Zhuang <haojian.zhuang@marvell.com>

192 GPIO pins are supported in pxa95x.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Chao Xie <chao.xie@marvell.com>
---
 arch/arm/mach-pxa/pxa95x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c
index 0ee166b..83ecc41 100644
--- a/arch/arm/mach-pxa/pxa95x.c
+++ b/arch/arm/mach-pxa/pxa95x.c
@@ -236,7 +236,7 @@ static struct clk_lookup pxa95x_clkregs[] = {
 void __init pxa95x_init_irq(void)
 {
 	pxa_init_irq(96, NULL);
-	pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
+	pxa_init_gpio(IRQ_GPIO_2_x, 2, 191, NULL);
 }
 
 /*
-- 
1.7.0.4

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

* [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip
  2011-09-09  3:28 ` Eric Miao
@ 2011-09-09  5:30   ` Chao Xie
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Xie @ 2011-09-09  5:30 UTC (permalink / raw)
  To: linux-arm-kernel

When driver invoke disable_irq to disable the gpio irq, it will failed to mask the bit in gpio register. Irq will still generate although the irq_handler for the gpio is not invoked.

-----Original Message-----
From: Eric Miao [mailto:eric.y.miao at gmail.com] 
Sent: Friday, September 09, 2011 11:28 AM
To: Chao Xie
Cc: linux-arm-kernel at lists.infradead.org; Haojian Zhuang; linux at arm.linux.org.uk
Subject: Re: [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip

Chao,

I actually don't see why do we need irq_disable() here?

On Thu, Sep 8, 2011 at 9:18 PM, Chao Xie <chao.xie@marvell.com> wrote:
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
> ---
> ?arch/arm/plat-pxa/gpio.c | ? ?1 +
> ?1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
> index a11dc36..15de09d 100644
> --- a/arch/arm/plat-pxa/gpio.c
> +++ b/arch/arm/plat-pxa/gpio.c
> @@ -263,6 +263,7 @@ static struct irq_chip pxa_muxed_gpio_chip = {
> ? ? ? ?.irq_ack ? ? ? ?= pxa_ack_muxed_gpio,
> ? ? ? ?.irq_mask ? ? ? = pxa_mask_muxed_gpio,
> ? ? ? ?.irq_unmask ? ? = pxa_unmask_muxed_gpio,
> + ? ? ? .irq_disable ? ?= pxa_mask_muxed_gpio,
> ? ? ? ?.irq_set_type ? = pxa_gpio_irq_type,
> ?};
>
> --
> 1.7.0.4
>
>

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

end of thread, other threads:[~2011-09-09  5:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09  4:18 [PATCH 1/4] ARM: mmp: add irq_disable callback for gpio chip Chao Xie
2011-09-09  3:28 ` Eric Miao
2011-09-09  5:30   ` Chao Xie
2011-09-09  4:18 ` [PATCH 2/4] ARM: mmp: add irq_disable callback for icu chip Chao Xie
2011-09-09  4:18 ` [PATCH 3/4] ARM: pxa: add irq ack for gpio irq Chao Xie
2011-09-09  3:22   ` Eric Miao
2011-09-09  4:18 ` [PATCH 4/4] ARM: pxa: update gpio number to 192 Chao Xie
2011-09-09  3:28   ` Eric Miao

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).