linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Assign line names at runtime
@ 2024-01-11 16:52 Westermann, Oliver
  2024-01-12  0:35 ` Kent Gibson
  0 siblings, 1 reply; 10+ messages in thread
From: Westermann, Oliver @ 2024-01-11 16:52 UTC (permalink / raw)
  To: warthog618@gmail.com
  Cc: Westermann, Oliver, brgl@bgdev.pl, linux-gpio@vger.kernel.org

Hey and thanks for your responses, those are actually quite insightful.

What I read from that is that changing line names really has a lot of implications.

Kent Gibson wrote:
> Alternatively, are named lines the right solution to your problem?
> Is it important to you that the lines are correctly named, or are you
> just using the name for the chip/offset lookup? 

We would really like to use named lines as they are really convinient, but your question actually made me rethink my initial question. We do actually not want to change line names, they are constant throughout the runtime of a device.

> If the latter perhaps roll your own pinout lookup based on the platform configuration?

The truth might lay in between: We would prefer to use existing features and standard interfaces instead of rolling out our own layer. But maybe it's just the initial naming that we want to move. A better solution might be to add another option to define and probe the GPIO driver at runtime: Instead of being required to set all information in the dtb (and therefore from a very low level), we might trigger the probing through modprobe and provide the GPIO line names from userspace. I'm not sure if such an option exists currently?

Best regards and sorry for the quoting style, our mailservers mess with your mails.

- Olli

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Assign line names at runtime
@ 2024-01-11 10:42 Westermann, Oliver
  2024-01-11 15:10 ` Bartosz Golaszewski
  2024-01-12  8:33 ` Alexander Dahl
  0 siblings, 2 replies; 10+ messages in thread
From: Westermann, Oliver @ 2024-01-11 10:42 UTC (permalink / raw)
  To: linux-gpio@vger.kernel.org

Hey,

I hope that this is the right place to ask a question in regards to gpiod, if not, feel free to point me the right way. We're transitioning from using the old sysfs interface to using gpiod and named lines. For most devices, we specify line names at boot time using gpio-line-names.

On some devices we have small differences between revisions or hardware variants, which causes lines to be swapped on GPIO expanders or just being used differently for between revisions. We started to handle this by overlays, but that requires to distinguish during the bootloader phase, which is hard to service and often unneeded. Especially when we want to rename a single line, the overlay needs to override all entries, which leads to duplication of those line name lists.

Is there a way to assign or change the line-name value at runtime?
If not today, would that be a desired feature (as we're looking for way to test contributing back)?

Best regards, Olli

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

end of thread, other threads:[~2024-01-18 23:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11 16:52 Assign line names at runtime Westermann, Oliver
2024-01-12  0:35 ` Kent Gibson
2024-01-12 11:26   ` Bartosz Golaszewski
2024-01-12 12:31     ` Kent Gibson
2024-01-12 13:16       ` Westermann, Oliver
2024-01-18 23:48         ` Kent Gibson
  -- strict thread matches above, loose matches on Subject: below --
2024-01-11 10:42 Westermann, Oliver
2024-01-11 15:10 ` Bartosz Golaszewski
2024-01-11 16:28   ` Kent Gibson
2024-01-12  8:33 ` Alexander Dahl

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).