[PATCH 2/2] pinctrl: sirf: put gpio interrupt pin into input status automatically

Linus Walleij linus.walleij at linaro.org
Wed Jan 15 03:12:47 EST 2014


On Sat, Jan 11, 2014 at 9:48 AM, Barry Song <21cnbao at gmail.com> wrote:

> From: Barry Song <Baohua.Song at csr.com>
>
> busses like i2c, spi and so on can parse the virq of their subnode automatically by
> irq_of_parse_and_map(). for example, i2c will do that in of_i2c_register_devices().
> people can put hwirq number attached to a gpio controller in dts, and drivers can
> directly request the parsed virq.
>
> for example, for an i2c client as below,
> tangoc-ts at 5c{
>         compatible = "pixcir,tangoc-ts";
>         interrupt-parent = <&gpio>;
>         interrupts = <3 0>;
>         reg = <0x5c>;
> };
> in i2c client probe(), it will request_irq(client->irq, ...) without
> calling gpio_direction_input().
> so here when we set irq type, we also put the pin to input direction.
>
> Signed-off-by: Barry Song <Baohua.Song at csr.com>

OK this makes perfect sense, and is not really related to DT: we recently
concluded that it should always be possible to request an IRQ from an
irqchip without having to interact with the GPIO interface first. So this is
doing the right thing.

However to keep things strict we need to add calls to mark the GPIO
lines used for IRQ, I'll see if I can fix a quick patch for this so you can
test.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list