From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2F9FC00523 for ; Sat, 4 Jan 2020 00:38:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9592C20866 for ; Sat, 4 Jan 2020 00:38:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MuL59PMN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727183AbgADAiw (ORCPT ); Fri, 3 Jan 2020 19:38:52 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37395 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727074AbgADAiv (ORCPT ); Fri, 3 Jan 2020 19:38:51 -0500 Received: by mail-lf1-f68.google.com with SMTP id b15so32930991lfc.4 for ; Fri, 03 Jan 2020 16:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7uC7JWFx9OYNnl310U+ygwv67SYyeHmDQsyNae/VGhA=; b=MuL59PMNVVu75FiAbIkclAny8nz760/4Z2GfHF30DCsopTe93BZOBYrLPjR6gD61X2 Ia+4C7u+qJ4p2FyZtfAjId1AXzKlKxic1WMzqQg3NK3gBNXV+ez2toaBlaN1/drja0og tIKURSFgHmO9j4DdW9Kg1qqGdU8X4KroveTVqF1A7gOlP2tT27bciMW13pYilBQg6pZn a+2PY4wz/bporm9hUJNRMPypAoDIa3/U2adVPtQMJv9LEO7KBcF8N+TWsqrpBnJmw+aM gkmDtXdZ7UfMFin1mBsGFfPqu0VvKDX866NlPztG0aOz3SZpNjkSJgcIgQz5IArawDNs HyBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7uC7JWFx9OYNnl310U+ygwv67SYyeHmDQsyNae/VGhA=; b=WtOlt1bIdyYkoVfbiCtxRtI4Mno1vQERIsz4I/6wq/ujy3X+lr1Dnj0/LinmKrLe+c vq5Q0LkGA1GB0sWvJ8yhahPvMZbQXC/mfL0/5YMB2MJP1JWtxVR5XN+mrzjCIGvV4TRG z4d64XzgVOW665gKzdDmvLjtmG9m3z2waK5GVl3e77w0GNA1Gh+H5MsIU5qCW8LpY4Bk 2/9Qp9pjIFNJlTPCHnJPKvYxqd2mNWilcxbd49PjIxmLvNS8a3tG330EdUXeOyIEz1Gp KKVeZogt4n4Qck7P59IuGn/FFEFOqqQ32ZoaRyVvE3eBTMYiGnQwyWMo63C8lxtWCFR9 5lzw== X-Gm-Message-State: APjAAAW/PncY/GOtoWjvOgTsTIj9n47QrfLCExgdMhYB0L19P243xDxW L5ohPJdOJ7jT80jbpRhTdJ7UElizoUl46drUMax/xA== X-Google-Smtp-Source: APXvYqx7qnNmzEGHh3l0ybIURRNlv3h+0jMWrPNsddLXYBAWaFoIfBU2PrBmBZ6fwZizOYviRGZkOY/zqCQGjuwVAnQ= X-Received: by 2002:a19:c0b:: with SMTP id 11mr52456055lfm.135.1578098329258; Fri, 03 Jan 2020 16:38:49 -0800 (PST) MIME-Version: 1.0 References: <20191127084253.16356-1-geert+renesas@glider.be> <20191127084253.16356-6-geert+renesas@glider.be> In-Reply-To: From: Linus Walleij Date: Sat, 4 Jan 2020 01:38:38 +0100 Message-ID: Subject: Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver To: Geert Uytterhoeven Cc: Geert Uytterhoeven , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Mark Rutland , Harish Jenny K N , Eugeniu Rosca , Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , "open list:GPIO SUBSYSTEM" , Linux Doc Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-Renesas , "linux-kernel@vger.kernel.org" , QEMU Developers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for slowness... christmas. On Thu, Dec 12, 2019 at 4:24 PM Geert Uytterhoeven wrote: > On Thu, Dec 12, 2019 at 3:34 PM Linus Walleij wrote: > > > + 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". > > 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? > > > + 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? The rest I think we cleared out else I will see it when I review again. Yours, Linus Walleij