Thread (48 messages) 48 messages, 8 authors, 2020-01-20

Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2020-01-06 08:23:22
Also in: linux-doc, linux-gpio, linux-renesas-soc, lkml, qemu-devel

Hi Linus,

On Sat, Jan 4, 2020 at 1:38 AM Linus Walleij [off-list ref] wrote:
Sorry for slowness... christmas.
Np. Happy New Year!
On Thu, Dec 12, 2019 at 4:24 PM Geert Uytterhoeven [off-list ref] wrote:
quoted
On Thu, Dec 12, 2019 at 3:34 PM Linus Walleij [off-list ref] wrote:
quoted
quoted
+         This can serve the following purposes:
+           1. Assign a collection of GPIOs to a user, or export them to a
+              virtual machine,
This is ambiguous. What is a "user"? A process calling from
userspace? A device tree node?
A user is an entity with a UID, typically listed in /etc/passwd.
This is similar to letting some, not all, people on the machine access
the CD-ROM drive.
Ah I get it. Maybe we can say "assign permissions for a collection
of GPIOs to a user".
OK
quoted
quoted
I would write "assign a collection of GPIO lines from any lines on
existing physical GPIO chips to form a new virtual GPIO chip"

That should be to the point, right?
Yes, that's WHAT it does. The WHY is the granular access control.
So I guess we can write both?
OK.
quoted
quoted
quoted
+           3. Provide a generic driver for a GPIO-operated device, to be
+               controlled from userspace using the GPIO chardev interface.
I don't understand this, it needs to be elaborated. What is meant
by a "GPIO-operated device" in this context? Example?
E.g. a motor. Or a door opener.

        door-opener {
                compatible = "mydoor,opener";

                gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>;
        };

You don't need a full-featured kernel driver for that, so just bind the
gpio-aggregator to the door-opener, and control it through libgpiod.
Yep it's a perfect industrial control example, I get it.

Maybe we should blurb something about industrial control?
OK.
The rest I think we cleared out else I will see it when I review again.
The remaining discussion point is "GPIO Repeater in Device Tree", i.e.
the GPIO inverter usecase, which might be solved better by adding a
GPIO_INVERTED flag.

Shall I rip that out, incorporate review comments, and report?

Thanks!



--
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help