preferable method for pinctrl driver

Linus Walleij linus.walleij at
Fri Nov 14 02:01:47 PST 2014

On Fri, Nov 7, 2014 at 11:17 AM, Oleksij Rempel <linux at> wrote:

>> thank you for your previous response. One more question: how pins should
>> be numbered? Continuous or register offsets can be used?
>> Documentations for this soc use pin names encoded like this
>> #NAME_#BANK_#PIN. Register offset can be calculated by ((bank) * 32 +
>> (pin) * 4)
>> In this case i need to have extra array to convert pin number to offset,
>> or use offset as pin number.
> Never mind, i think i found the answer:
> This enumeration was arbitrarily chosen, in practice you need to think
> through your numbering system so that it matches the layout of registers
> and such things in your driver, or the code may become complicated. You
> must also consider matching of offsets to the GPIO ranges that may be
> handled by the pin controller.

Yeah you're right :)

There is some resoning in Documentation/pinctrl.txt but it needs some
intuition etc.

Linus Walleij

More information about the linux-arm-kernel mailing list