[U-Boot] [RFC PATCH v2 13/13] tegra: Convert tegra GPIO driver to use driver model

Stephen Warren swarren at wwwdotorg.org
Tue May 6 22:37:28 CEST 2014


On 05/06/2014 02:28 PM, Simon Glass wrote:
...
> The GPIO uclass does sequentially number GPIOs, but be aware that on
> platforms with multiple GPIO controllers (e.g. an I2C GPIO extender) you
> might hit a problem where the tegra GPIOs are not first, so might start
> at 8 or 16, for example. However I think that probably can be resolved
> when we come to it.

That fact shouldn't be exposed to the user. If all the GPIO IDs are
relative to a specific named GPIO device, then the user will never see
the internal offset. Indeed, the GPIO driver for a particular GPIO HW
module/chip wouldn't ever see the offset either. In fact, we shouldn't
have/introduce a flat/global GPIO numbering space at all. The Linux
community has learned that doesn't work very well, and is moving away
from it in the more recent "gpiod" API for example. Everything should be
identified as a tuple (GPIO controller handle, GPIO ID within that GPIO
controller).



More information about the U-Boot mailing list