[PATCH] gpio: omap: make gpio numbering deterministical by using of aliases

Linus Walleij linus.walleij at linaro.org
Tue Jun 14 23:56:58 PDT 2016


On Tue, Jun 14, 2016 at 12:03 PM, Uwe Kleine-König
<u.kleine-koenig at pengutronix.de> wrote:

> Traditionally the n-th gpio device probed by the omap gpio driver got
> the gpio number range [n*32 .. n*32+31].
> When order of the devices probed by the driver changes (which can happen
> already now when some devices have a pinctrl and so the first probe
> attempt returns -ENODEV) the numbering changes.
>
> To ensure a deterministical numbering use of_alias_get_id to determine
> the number base for a given device. If no respective alias exists fall
> back to the traditional numbering.

I'm not too happy about this approach.

The patch doesn't mention what practical problems it is trying to
solve.

I am very much suspecting the sysfs ABI to be what you're trying to
get consistent, and that is OBSOLETED, see
fe95046e960b4b76e73dc1486955d93f47276134
"gpio: ABI: mark the sysfs ABI as obsolete"

The GPIO numbering scheme is a matter of Linux internals and
not about hardware description IMO.

The way forward is to use the character device and use gpiochip
devices with offset indexes and look up GPIOs by name from the
character devices. If nothing substantial happens I am merging the
final pieces of the GPIO chardev ABI for v4.8 and that is doing all that
sysfs was doing and then some. I just need to change a small thing
before sending the final version for review.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list