Re: [PATCH] gpiolib: Add gpio_detect, gpio_debounce and gpio_alt_func features to GPIOLIB



On Tue, Jun 16, 2009 at 09:28:48AM +0800, Alek Du wrote:
On Mon, 15 Jun 2009 21:09:06 +0800
Ben Dooks <ben-linux@xxxxxxxxx> wrote:


I would expect your architecture IRQ handler to have a set_type callback for
the GPIO lines capables of generating an interrupt. See how we have beeing
doing it for rb532 for instance:
http://www.linux-mips.org/git?p=linux-queue.git;a=blob;f=arch/mips/rb532/irq.c;h=f07882029a90d3d155c17b462812c2936229458c;hb=HEAD#l173

Yes, or if the GPIO driver is exporting interrupts, the relevant handler
for that chip should have the .set_type method defined.


In the .set_type method, you finally will call the GPIO driver's function to set interrupt trigger mode, right?

No, that's totaly the wrong way around. GPIOLIB provides an GPIO to IRQ
function that the driver providing the GPIOLIB chip needs to provide. To do
IRQs, the same driver will have to provide a irq chip and that is the place
where this functionality should reside.

Current GPIOLIB do not provide such an interface. Current driver always exports a separate function to do that --
that's not good.
My patch provide a general API to do that.

When there's already an extant API to do that. There are drivers already
doing it this way.

--
Ben

Q: What's a light-year?
A: One-third less calories than a regular year.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Drawing Test Fails in Touch Panel CETK
    ... Is your touch driver sampling the stylus inputs once a pen-down event comes ... Notice how once IRQ_ADC interrupt has occured, ... For Drawing I think, Main problem is, I get only one gpio interrupt ...
    (microsoft.public.windowsce.platbuilder)
  • Re: GPIO driver for pxa270
    ... while searching i got a wince gpio sample code from colibri toradex. ... BOOL KernelIoControl(DWORD dwIoControlCode, LPVOID lpInBuf, DWORD ... // General Interrupt Handling Section ... Since the GPIO IRQ is shared by all the GPIOs ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Serial related oops
    ... IRQ sharing is stupid yet universal, ... the interrupt line if no driver services the interrupt. ...
    (Linux-Kernel)
  • Re: Drawing Test Fails in Touch Panel CETK
    ... Is your touch driver sampling the stylus inputs once a pen-down event comes ... Notice how once IRQ_ADC interrupt has occured, ... Touch panel is working fine i.e. ... gpio and timer irq to TouchEvent handle. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: NIC fails in RELEASE build CE 5.0
    ... Basically, I have set the NIC to use IRQ 0x0A, and I have left it as Either ... it looks like the driver just takes the IRQ and maps it to the first unused ... What I don't see is where the hardware interrupt is actually enabled. ... I get this sequence repeated while DHCP keeps ...
    (microsoft.public.windowsce.platbuilder)