On Tue, Oct 25, 2016 at 4:47 PM, Marc Zyngier <marc.zyngier@xxxxxxx> wrote: > On 25/10/16 15:22, Jerome Brunet wrote: >> There is a few problems to guarantee that gpio == hwirq. >> 1. We have 2 instances of pinctrl, to guarantee that the linux gpio >> number == hwirq, we would have to guarantee the order in which they are >> probed. At least this my understanding > > Maybe I wasn't clear enough, and my use of gpio is probably wrong. So > Linux has a gpio number, which is obviously an abstract number (just > like the Linux irq number). But the pad number, in the context of given > SoC, is constant. So we have: > > pad->gpio > hwirq->irq > > Why can't you have pad == hwirq, always? This is already what you have > in the irqchip driver. This would simplify a lot of things. My thought as well. We usually refer to the local numberspace on the GPIO controller as "offsets", so line offsets 0...31 on a gpiochip with 31 lines. The ngpio in struct gpio_chip is the number of lines on that controller, and should nominally map 1:1 to hwirq sources. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html