Skip to content

Commit

Permalink
pinctrl: sirf: put gpio interrupt pin into input status automatically
Browse files Browse the repository at this point in the history
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@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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
21cnbao authored and linusw committed Jan 15, 2014
1 parent 8daeffb commit b07ddcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/sirf/pinctrl-sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static int sirfsoc_gpio_irq_type(struct irq_data *d, unsigned type)
spin_lock_irqsave(&sgpio_lock, flags);

val = readl(bank->chip.regs + offset);
val &= ~SIRFSOC_GPIO_CTL_INTR_STS_MASK;
val &= ~(SIRFSOC_GPIO_CTL_INTR_STS_MASK | SIRFSOC_GPIO_CTL_OUT_EN_MASK);

switch (type) {
case IRQ_TYPE_NONE:
Expand Down

0 comments on commit b07ddcd

Please sign in to comment.