Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp19134502ybl; Fri, 3 Jan 2020 16:39:47 -0800 (PST) X-Google-Smtp-Source: APXvYqw7XXt6Cguc3dzN6gqGVXbAsd9o++Sz1akk53nZmyHuBKCrFUUUYw4JBIDpwrT9ZKaPQGCW X-Received: by 2002:a9d:750b:: with SMTP id r11mr98056460otk.209.1578098387547; Fri, 03 Jan 2020 16:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578098387; cv=none; d=google.com; s=arc-20160816; b=jpSm8nqVCp7hKe29WG8uAtY03IwMLuC32Ku57HS1UMxNYJphGL4rejCAEun+SUW1iV U/1OOM3QtPCeAdMkSSNWyqCX2NY550GQjsjH9IXoAlwnTS2SxNoH2Pfgfhi76xkldHk6 bHo7/zKwoFJB3HSoPbSVw/ZVRWh4iguN0Ts9qMjY6fLsF/a0WVA+EJ2dbPGiQ0gCe4b5 3OZAus6sTguvoin50w29Du/SwN2fPWyWOj4xlCSXIisRqnJuZoHYyqKrevC6uJsdZmEH BxjsVpEzPbH3DOUs1UfgNDsky19Qfqv+itLkbwoH+Qi6+RfvgS6BKPu4M1nqmswzzAaZ cXmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7uC7JWFx9OYNnl310U+ygwv67SYyeHmDQsyNae/VGhA=; b=H724o3Z1btieyWmtP8o8GK3twZy1XIlumMAx8vlIYk4jgk6JuLGqejNqg5y/in7J5D k7dm6rlN+3tVimDxa10PM+rXsjxoW/AHl/fgnwnXeYfNuDDS7ToHoXMwen7TzzxsEbVk +G7KGu/otxpLbr7+DXKBN8uXHcGxWS6JV/Us2l5nipP9hBdqFiy8N9U+t3Jju5UKLLFy BQg46WF6i7vtByp9akJJoXPPHUmkFJ6/L/ujNmo8KWca9C7unBoTvi0Ji13n44MkoHU+ sjpUqE3FHoMo81Y366AqejuCiRw/+8YRzgckkhhfWnO/7BHcragv0vM1mQfog17aYwXz 4Xnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuL59PMN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14si31945862oto.127.2020.01.03.16.39.35; Fri, 03 Jan 2020 16:39:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuL59PMN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbgADAiw (ORCPT + 99 others); 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-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