On Wed, Feb 24, 2021 at 3:34 AM William Breathitt Gray <vilhelm.gray@xxxxxxxxx> wrote: > On Tue, Feb 23, 2021 at 06:45:16PM +0100, Oleksij Rempel wrote: > > > to make this possible, i would need hack gpiolib framework and add > > > name/label exporter. But after endless rounds of pingponging me for > > > renaming the driver and removing interrupt handler, i feel like we are > > > not having serious discussion for mainlining this driver. > > > > Probably for good reason, struct gpio_desc was made local and is located > > in the drivers/gpio/gpiolib.h. It feels like additional hack to include > > it. I assume, it should be done properly so there is a function to > > provide gpio name or label. > > > > @Linus Walleij are there any good way to get the GPIO name? And which > > name will be actually used? A label provided over devicetree? > > Perhaps one of the GPIO subsystem maintainers can provide more guidance > here, but I was under the impression that this name was provided > statically by the respective GPIO driver via their struct gpio_chip. I > think you can see the array of names via priv->gpio->gdev->chip->names. These names can be set either through device properties on the GPIO chip "line-names" such as through device tree, or as static names in the .names array on struct gpio_chip for chips that are e.g. hot-pluggable and does not have a hardware description associated. These names should be something like what the signal is called on the circuit board rail. gpiolib further has a function: gpiod_set_consumer_name() that can be used by consumers to set their use case for the line, which makes it appear in debugfs etc. The consumer name does not need to be unique. These names have no practical use other than debugging or userspace representation. I hope this helps. Yours, Linus Walleij