lkml.org 
[lkml]   [2007]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: question on generic gpio interface
Date
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-16 15:49    [W:0.136 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site