linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mike@compulab.co.il (Mike Rapoport)
To: linux-arm-kernel@lists.infradead.org
Subject: enabling EXT_WAKEUP interrupts on PXA3xx
Date: Tue, 10 Nov 2009 10:14:28 +0200	[thread overview]
Message-ID: <4AF920E4.2070803@compulab.co.il> (raw)
In-Reply-To: <f17812d70911092335v3e198921u878f406a8c59ffda@mail.gmail.com>

Eric Miao wrote:
> On Tue, Nov 10, 2009 at 3:34 PM, Eric Miao <eric.y.miao@gmail.com> wrote:
>> On Tue, Nov 10, 2009 at 3:28 PM, Daniel Mack <daniel@caiaq.de> wrote:
>>> On Tue, Nov 10, 2009 at 09:22:00AM +0200, Mike Rapoport wrote:
>>>> We need to enable EXT_WAKEUP interrupts on PXA3xx and I wonder what would be the
>>>> best way to do it.
>>>> I see two possibilities:
>>>> 1) add 'if (irq == IRQ_WAKEUPx)' statements to pxa_{un}mask_irq functions in
>>>> arch/arm/mach-pxa/irq.c
>>>> 2) register additional irq_chip in arch/arm/mach-pxa/pxa3xx.c that will be
>>>> responsible for handling EXT_WAKEUP (and probably other pxa3xx specific) interrupts.
>>>>
>>>> What do you prefer?
>>> I'm just calling
>>>
>>>  enable_irq_wake(IRQ_WAKEUP0);
>>>
>>> from my board support code, and it works fine - no need to change
>>> anything else.
>>>
>> Daniel,
>>
>> I think Mike is talking about "interrupt" on EXT_WAKEUP0, which involves
>> register PECR.
>>
>> My POV is the 2nd way to go, should be better and cleaner, but I'm always
>> wondering where to add these additional two interrupts, possibly before
>> the GPIO IRQs or after.
>>
> 
> Well, my second thought on this would be after GPIO IRQs and treat
> them as board specific ones.
> 

Currently we have
#define IRQ_WAKEUP0	PXA_IRQ(49)	/* EXT_WAKEUP0 */
#define IRQ_WAKEUP1	PXA_IRQ(50)	/* EXT_WAKEUP1 */
so probably we'll just treat them in a way similar to IRQ_GPIO[0,1]:

diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index d694ce2..bfc57e6 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -118,6 +118,24 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	pxa_low_gpio_chip.set_wake = fn;
 }

+static struct irq_chip pxa_ext_wakeup_chip = {
+	.name		= "EXT-WAKEUP",
+	.ack		= pxa_ack_ext_wakeup,
+	.mask		= pxa_mask_ext_wakeup,
+	.unmask		= pxa_unmask_ext_wakeup,
+};
+
+static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
+{
+	for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
+		set_irq_chip(irq, &pxa_ext_wakeup_chip);
+		set_irq_handler(irq, handle_edge_irq);
+		set_irq_flags(irq, IRQF_VALID);
+	}
+
+	pxa_ext_wakeup_chip.set_wake = fn;
+}
+
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 {
 	int irq, i;
@@ -146,6 +164,9 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)

 	pxa_internal_irq_chip.set_wake = fn;
 	pxa_init_low_gpio_irq(fn);
+	
+	if (cpu_is_pxa3xx())
+		pxa_init_ext_wakeup_irq(fn);
 }



-- 
Sincerely yours,
Mike.

  reply	other threads:[~2009-11-10  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10  7:22 enabling EXT_WAKEUP interrupts on PXA3xx Mike Rapoport
2009-11-10  7:28 ` Daniel Mack
2009-11-10  7:34   ` Eric Miao
2009-11-10  7:35     ` Eric Miao
2009-11-10  8:14       ` Mike Rapoport [this message]
2009-11-10  8:24         ` Eric Miao

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=4AF920E4.2070803@compulab.co.il \
    --to=mike@compulab.co.il \
    --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;
as well as URLs for NNTP newsgroup(s).