mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: "Francis Moreau" <francis.moro@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: question on generic gpio interface
Date: Mon, 16 Apr 2007 06:46:59 -0700	[thread overview]
Message-ID: <200704160646.59407.david-b@pacbell.net> (raw)
In-Reply-To: <38b2ab8a0704160303l7c550c2dq3b700b2e93d01a7@mail.gmail.com>

On Monday 16 April 2007 3:03 am, Francis Moreau wrote:

> > Good .. this is more like an IRQ question though.
> 
> ...
> 
> > IRQ logic on that platform must do a few things, like:
> >
> >  - NR_IRQS includes the N interrupts triggered from that chip,
> >    and their numbers probably fit right sometime after the
> >    core set of IRQs (which might include SOC GPIO irqs);
> >
> >  - You'll provide an irq_chip for this controller, and it will
> >    handle the relevant irq operations (set trigger type, mask,
> >    unmask etc);
> >
> >  - When configuring the IRQ handler for that "same IRQ", you'll
> >    set it up to use a chained handler that you provide, which
> >    reads the register to see which gpio(s) triggered the IRQ,
> >    maybe acks it (if just reading that register isn't enough),
> >    and then calls whatever handler was instaled for that GPIO.
> >
> > If that's not familiar to you, look at arch/arm/mach-at91/gpio.c
> > or arch/arm/mach-pxa/irq.c or arch/arm/plat-omap/gpio.c or a
> > number of other similar files showing how the "toplevel" IRQ
> > logic will demux from a "one of these N GPIOs" interrupt down
> > to the handler for that particular IRQ.
> >
> 
> I think I got the picture now, thanks again.
> 
> Just to be sure I understand, it seems to me that your point 2) and 3)
> are 2 different approaches to do the same thing, aren't they ?

No, all of those need to be done.  (Plus maybe a few more things,
I wasn't trying to be exhaustive.)  That last point is what makes
the other ones take effect ... without it, the top level IRQ will
never get dispatched to the GPIO-specific IRQ.

Look at the examples I referenced.


> If so I can only implement 2) since it seems to me better than the
> last one (it better uses genirq layer).

No, implementing all of those points is required.  That's how
the relevant parts of the IRQ layer connect to each other.

- Dave

  reply	other threads:[~2007-04-16 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 20:51 Francis Moreau
2007-04-13 22:43 ` David Brownell
2007-04-16 10:03   ` Francis Moreau
2007-04-16 13:46     ` David Brownell [this message]
2007-04-17  7:04       ` Francis Moreau
2007-04-17 16:42         ` David Brownell
2007-04-19  8:05           ` Francis Moreau
2007-04-19 18:06             ` David Brownell

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=200704160646.59407.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=francis.moro@gmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®