Device Tree Property for Setting of Labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All;

I have a need to reliably identify GPIO pins in userspace,
specifically I would like the method I use to be invariant to
declaration order in the device tree (so not based on gpiochip#.)

There doesn't seem to be any existing method to accomplish this; and
there's no existing device tree property in pinctrl that I can see, or
in any driver that I looked at, that would persistently set a label,
name, or other queryable property. (Although some devices like the
stm32pinctrl add a sysfs node like st,bank-name.)

I propose that a new optional property `label` or `names` is added to
the base pinctrl schema that drivers would then use to set the `label`
property in `struct gpio_chip` which can be queried from userspace via
`GPIO_GET_CHIPINFO_IOCTL`.

Two things come to mind to consider in this scheme
1) I think I've seen other solutions like this where the device tree
node name is used instead of some additional property, but that seems
like it would be a breaking change if accepted because then all the
labels would change as the drivers are updated.

2) Some pinctrl devices (I'm dealing with an mcp23sxx) register
multiple chips under the same node. Right now the label is assigned by
<mcp23sxx>.<address> and it could be something similar such as <label
| mcp23sxx>.<address> but if we had a property that accepted a list of
strings then each one could have a unique label if desired.

If this is an acceptable proposal then I'll put together some patches.
Or if someone else has a method I could use instead that already
exists I'd love to hear about it.

Thanks,
Matt Walker



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux