linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* setting gpio-line-names in dts for sama5d2 SoC
@ 2021-03-16 13:07 Alexander Dahl
       [not found] ` <CAHp75Vf05NN0dXUrMSOXBRuYRnQRHO_92itZ3ndOyX1oERWt=g@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Dahl @ 2021-03-16 13:07 UTC (permalink / raw)
  To: linux-gpio

Hei hei,

for a Microchip SAMA5D2 SoC based device I try to set gpio-line-names in .dts file like this:

257 &pioA {                                                                 
258         gpio-line-names = "",                   /* PA0  */              
259                           "",                   /* PA1  */              
260                           "",                   /* PA2  */              
261                           "FOO",                /* PA3  */              
262                           "BAR",                /* PA4  */              
263                           "",                   /* PA5  */              

… and so on for all 4 * 32 GPIO Pins. However when calling `gpioinfo` in userspace, I always get this:

$ gpioinfo 
gpiochip0 - 128 lines:
        line   0:        "PA0"       unused   input  active-high 
        line   1:        "PA1"       unused   input  active-high 
        line   2:        "PA2"       unused   input  active-high 
        line   3:        "PA3"       unused   input  active-high 
        line   4:        "PA4"       unused   input  active-high 
        line   5:        "PA5"       unused   input  active-high 

… and so on. Those "PA0" line names are set by the pinctrl driver in drivers/pinctrl/pinctrl-at91-pio4.c before calling gpiochip_add_data() and from reading the code in drivers/gpio/gpiolib.c I suspect devprop_gpiochip_set_names() is never called then, so those names in .dts are simply ignored.

Those default names from the at91 pio4 pinctrl driver are certainly correct speaking of pin names, but from a userspace point of view it would be better if I could override those from dts, so an application using libgpiod could look for a name like e.g. "VALVE7_EN" without caring to which pin that's actually connected. Can I override those with a currently present kernel? Or is it a problem in either the at91 pio4 driver or the gpiolib core? Or is that no real usecase and should I do it differently?

Greets
Alex

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-20 11:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 13:07 setting gpio-line-names in dts for sama5d2 SoC Alexander Dahl
     [not found] ` <CAHp75Vf05NN0dXUrMSOXBRuYRnQRHO_92itZ3ndOyX1oERWt=g@mail.gmail.com>
2021-03-17 12:33   ` Andy Shevchenko
2021-03-18  9:50     ` Alexander Dahl
2021-03-18 12:40       ` Andy Shevchenko
2021-03-18 13:56         ` Alexander Dahl
2021-03-18 14:59           ` Andy Shevchenko
2021-03-20 11:20             ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).