OK, if you want ...
I think s3c2443 is similar. For them just using the input mode for a
gpio isn't enough to get an irq, too. (At least if I believe my
collegues who work with that processor :))
IMHO pinmux and GPIO are not orthogonal. The GPIO API just choosed not
to bother about pinmuxing.
???
OK.
OK.
OK. (But then a general driver cannot make use of this function. IMHO
this should be noted in the docs. And then you can deprecate it ;))
There isn't "the pin". E.g. IRQ_NS9XXX_EXT0 can trigger on gpios 1, 9,
16 and 105 on ns9215. These are four different pins. What should I do
when two of them are in input mode? (I can remember for which gpios
gpio_to_irq was called, but this looks messy.)
Can I rely on drivers to first call gpio_direction_input and only then
request_irq? (Otherwise gpio_direction_input needs some addional logic,
too.) I have no real example, but I can imagine situations where the
gpio that should interrupt the cpu is used as output from time to time.
This might need some handling, too.
As far as I understand now this won't solve the problem of two gpios
sharing the same irq where only one of them should trigger the irq.
OK.
OK. This is a function I only found yesterday.
irq_to_gpio() already does the right thing[5] :-)
The task for request_irq isn't clear to me (yet). Implementing only
gpio_to_irq() isn't nice, because then gpio_key never gets an irq
(instead of just failing because gpio_to_irq() returns an error).
Another problem is that there isn't any support for ns9215 in the
vanilla kernel yet.
Other than that acking the irq is still open. I don't really want to
bother the generic irq-ack routine to do something like:
if (irq_is_external(irq) && extirq_is_configured_edgesensive(irq))
ackextirq(irq)
And only for that using a 2nd chip seems overkill to me.
Best regards
Uwe
[5]
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=include/asm-...
--
Uwe Kleine-König, Software Engineer
Digi International GmbH Branch Breisach, Küferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
--