>> There are several reasons why I am not using gpio* functions (whether
>> it makes sense or not is a different discussion). Independent of
>> that, I just want to understand how gpio number to irq number
>> mapping is organized. Let's say, as if I would need to write
>> gpio_to_irq() funciton myself. I was expecting some kind of
>> calculations involving gpio number, bunk number, some base offset,
>> etc. but was unable to find it. That is why I asked for pointers in
>> the mail list.
>
> Can you explain why you don't want to use the gpio* functions? They
> work rather well.
I am writing Xenomai (
xenomai.org) realtime driver (RTDM) to handle
quadrature encoders. This is rather new area for me and I am learning.
My reasons to avoid gpio* functions was the uncertainty if calling
Linux kernel functions (like gpio*) will cause the context switch from
real-time domain to non-real-time. That is why, for the first
prototype I decide to avoid these functions completely and configure
pins myself which works fine for output.
Now I want to handle rotary encoder inputs and need to react on
interrupts triggered by the gpio pins. Xenomai's RTDM API offers own
set of functions (similar to kernel's functions) to register interrupt
handlers. But, of course, I need to supply the IRQ number. And this is
where my original question came from.
> If you're curious as to what they do, use the source! :)
Sure. But I was hope to find some plain text explanations before
diving in the sources.
Thanks,
Andrey.