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

Simon Glass sjg at chromium.org
Tue May 6 22:41:13 CEST 2014


Hi Stephen,

On 6 May 2014 14:37, Stephen Warren <swarren at wwwdotorg.org> wrote:

> 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).
>
>
Well that would be fairly easy to add my modifying the gpio command.
Nothing we have talked about here precludes that, and driver model of
course supports it. We should be able to make it backwards compatible too.

Regards,
Simon


More information about the U-Boot mailing list