[PATCH] RFC: name the Raspberry Pi GPIO lines
Stephen Warren
swarren at wwwdotorg.org
Mon Oct 10 12:32:41 PDT 2016
On 10/06/2016 05:15 AM, Linus Walleij wrote:
> This is a scratch idea on how to properly name the GPIO lines
> on the various Raspberry Pi models.
>
> The idea is to give useful names to GPIO lines that an
> implementer will be using from userspace, e.g. for maker type
> projects.
>
> See:
> commit 521a2ad6f862
> ("gpio: add userspace ABI for GPIO line information")
> commit fd9c55315db9
> ("gpio: of: make it possible to name GPIO lines")
>
> And watch how nice I think it looks on lsgpio (I do not have
> a raspberry pi).
>
> I need help in getting the right names for the lines and
> matching the device tree to the right schematic so I don't
> get this wrong.
(Sorry if this is a dup; I thought I'd replied earlier, but my email
client thinks not.)
My quick thoughts:
* The idea sounds good to me.
* Does it make sense to name the GPIOs based on the RPI connector or the
SoC? I guess basing the naming on the expansion header makes most sense
since this is what most users deal with. Still, I believe most Pi GPIO
libraries have the option to allow callers to use either SoC or
expansion header numbering.
* I think the DT fragments should be identical for all boards with a
26-pin header, and for all boards with a 40-pin header. Can we share the
naming table rather than duplicating it? (Actually, there are probably 2
different mappings for the 26-pin header, since at least one of the I2C
ports was connected differently on earlier Pis).
* If we're going to name GPIOs based on the expansion connector, which
seems fine, I think we should simply not include mapping table entries
for the SoC GPIOs that aren't connected to the expansion header. Either
that, or prefix the unconnected names with something like "SoC:" to
distinguish them? Does it make sense to use a standard connector name as
a prefix for the expansion header GPIOs, e.g. "RPiExpansion:"?
More information about the linux-rpi-kernel
mailing list