Messages in this thread | | | From | Linus Walleij <> | Date | Mon, 28 Mar 2022 01:07:27 +0200 | Subject | Re: [PATCH v2] gpio: Allow setting gpio device id via device tree alias |
| |
On Tue, Mar 22, 2022 at 11:16 AM Bough Chen <haibo.chen@nxp.com> wrote:
> For users, usually, they will open /dev/gpiochipx to handle gpio related option.
That makes sense, it is intuitive in a way.
> By the way, how can user get the labels and device names of GPIO chips?
The way to get metadata for any /dev/* device such as topology on buses is through sysfs.
It is also possible to get labels for all gpiochips by iterating over them.
The most user-friendly thing to do is however to make use of libgpiod and associated example tools such as gpiodetect: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/
Yours, Linus Walleij
| |