Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21245630ybl; Mon, 6 Jan 2020 00:24:12 -0800 (PST) X-Google-Smtp-Source: APXvYqz9JwRWMJjNavlDnhQ2kaiUkSjaneE43GQPFJY1/++5GsaERiFtX4T3lqDhANFsfLey4m8N X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr107370118otc.24.1578299052200; Mon, 06 Jan 2020 00:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578299052; cv=none; d=google.com; s=arc-20160816; b=Zkc/GjXeLtcgF9ZtsUYR44whMr1/w496++MoSYnkbY6nl+R403Qvoc9EHyBzM98vjV t0nwsqN85dOtStREbHmJDu2zlDcT2ijd+K4c3h7W2dEx07V07PypNWZB5MYSIoyBMalA SCV7svJbOIIc0hPDnbMhCeTsPKIaE6qpUxgJ4iqvGWouW6u0uYbzpKYLvxlsXQVYxWua mbQMpV6rxzNjlKKchhYnLugV4590J0bD7JvLV/fX0fU3PEAVs2n0t07qsUrpwYAyIk4q k7xatBC1mMWxeFVxCmwCE3U4uVec1g/oFhtVdmeD1sKN5rjp51JDRi3D4azXDGgTbfmz okvg== 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; bh=nHzx9oIm8dg3P3nAkMNDZNXQcdUHwPZVhWt4WLorDDs=; b=xpB7mIEthg+Y8psejZHTTV4MHN2VCY+Zrt47XIaLjqOVAfZdosmlRhtnfuN6h25d0l mnUgaKs53FzFim1oKU+BQLUULVc+80uEwPb08EMTKmEEc9FRqJpQEg5zFTm/Mq1rapPQ dqX/yp9PfHf9oF9Bbxt+RhWznyooChK/SQfy8zJwCAJJSOAfykCq9Qs7UkWz+zpJX8nq X9CDttmKnqJy+4H83tDZ81drQgN0YvekXbEeYimSEPMIJU3aH6YzrwKMEaJg+DuUGMJT sC73YpPJNPXuSHgzL8ZPoXWo4mB2symHgIPNt1y0hAsTMKZb5KCYiQjS+/DSGuYJ4Q79 hCvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si35239451otp.316.2020.01.06.00.23.59; Mon, 06 Jan 2020 00:24:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbgAFIXV (ORCPT + 99 others); Mon, 6 Jan 2020 03:23:21 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:46958 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgAFIXV (ORCPT ); Mon, 6 Jan 2020 03:23:21 -0500 Received: by mail-ot1-f67.google.com with SMTP id q3so2128320otr.13; Mon, 06 Jan 2020 00:23:20 -0800 (PST) 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=nHzx9oIm8dg3P3nAkMNDZNXQcdUHwPZVhWt4WLorDDs=; b=phYeE/Wdm+GEGSJpXs8lIGU9xe2PFAgc/bp6jYq4tL24MIDALkO3x7PU7voblRy/wb 1FkNODmqSZPxYMWA8qvi8lSFsLsbiBdYqh+mQgjPSmZwm2viBLF/51rWFp0nUM58KBgf UUK2JyckwPeGBbcURpBod2F30WY/X3iFvuVtMrCWAFwwm1wv13Jk+edsWhX4lo+V+PFT PJSL8BqlyXpn++7FMJ8ly60IZJFh20lUHcE5EvFbth6VEeGXoCz8OW1J7BCsmqkU7KbZ eeQhTCKtxpGui/kVsm+EyUG9HxhGGRyJfGlLTOK+beFe0H5Hnx4Y8SI6c6wOTYlyyffg Q8Qg== X-Gm-Message-State: APjAAAX9x+PoW+5c5eYPyMAhIT2kjTJtKMnplH1Lj3URpWTDwDPTaq/L 9AO1WK8m633VPh6/SzooWjbxcnz7OTvqkGpE+mY= X-Received: by 2002:a9d:7984:: with SMTP id h4mr116835949otm.297.1578298999867; Mon, 06 Jan 2020 00:23:19 -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: Geert Uytterhoeven Date: Mon, 6 Jan 2020 09:23:08 +0100 Message-ID: Subject: Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver To: Linus Walleij 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 Hi Linus, On Sat, Jan 4, 2020 at 1:38 AM Linus Walleij wrote: > Sorry for slowness... christmas. Np. Happy New Year! > 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". OK > > > 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. > > > > + 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