Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3116701pxk; Mon, 7 Sep 2020 03:49:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEPCN3EDGAV0xwY5qRKHf93Qd6h0290aghD8P3xvrB9XjUJKm5z4eWVDW9ql3bPKkXHOOI X-Received: by 2002:a17:906:71c9:: with SMTP id i9mr19832893ejk.250.1599475774309; Mon, 07 Sep 2020 03:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599475774; cv=none; d=google.com; s=arc-20160816; b=z3URzxqSOfsc2TTrRdiN1pR1auHsmi4T04pIc+OwE3uQmWxuJu1Lxux2/4xba2urmd kYs2ZL1yvtRKinM/HMp4HzqxbgToDHgx7TEJHGkp9bGgvv/29haCnrND5BMuJZoeeDDT Q95tx4BUx2Auyc/8Eg4uyP2x8r6n3buAvGH6fJ4l3WJFlU+Q1nDjS/5wDURuOWMXPq1B 3+7uDPRhRohcatqOeeKPVVRzO3Y617KttNhSF0gLCkI9aPV6gZGS+exhbEujnzYJbwCQ XV2VSxtuSb5AHHsMhK23/qrsFdTyKVmdH74CnOdJS8vN9ozJiFd7asVJ6yM2pdivxRzY J6Gw== 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=3Cm3/iyepcYqpKZ6rltE2W8KEjZwGnNaTWPVuCOQ5Qg=; b=fwRNSr6j9AFZnSwutlCLHzYFf5YWSA2J7fcF9iYgbbnScCysSbaG4LMRLp+CqmIC2B AFJ5uyt2+7RdufLvnIRf9MBl950GXSV851WBKSY4t3Y8v4UbH82dJqhpQ+noD+KXpKfe PpAMXDeeExZ4JJwhZ28PjrRt7itunUPsEO8vRyokmjFWClr6LQxB/+Br028XCqowMb8X XXBXjBydURCTW17SsTGgqUfO3m517ZZpy+SdlnjT9T1ov+eW64F8PFjUCiP531ueUecO OMXkQwVKJixrPlfy5rpodlpv3QvckV0vRFgtXU/a3BzKc2dP+QUdyRZxCmGOOCIHLTp0 T8zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=T+t+Kc7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si9040373ejk.222.2020.09.07.03.49.11; Mon, 07 Sep 2020 03:49:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=T+t+Kc7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728575AbgIGKqX (ORCPT + 99 others); Mon, 7 Sep 2020 06:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728852AbgIGKqL (ORCPT ); Mon, 7 Sep 2020 06:46:11 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E20D6C061575 for ; Mon, 7 Sep 2020 03:46:08 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id j2so13481161ioj.7 for ; Mon, 07 Sep 2020 03:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3Cm3/iyepcYqpKZ6rltE2W8KEjZwGnNaTWPVuCOQ5Qg=; b=T+t+Kc7icHKQwmPmJycGZ7/uULY35LFJjcaWVtrCwWckJlS/9Mvo3cJmYr1cnNq+Zw RUzZJVxKUpVcG8BwfbcBYW182+wupDMxsgPCB54NQ3zo2un1/TAbT/X4yMEOcauVzdCx PhFDQ0yn5mzyvdIZ2sWhI4QAm6gtcuRGZWJokSiBh8HLgqNIuscGlbNxTwKffizwwgkw ai5RVJ9Bnc5qGED5cU4egn0aALRWsiPyUDOHPpTKPYNRDpz7tTyxyeQ04bKH9Itq9hpZ Qcpnd2P3+rNkQwDPE1iQKcXDzfCwqmprvDn0Tp/23ExA/9wCzD0Ot9xaxO3rp+05lZmT SWZQ== 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=3Cm3/iyepcYqpKZ6rltE2W8KEjZwGnNaTWPVuCOQ5Qg=; b=aB+fJrgwaa/rmTh0lI0oQxj/0H6o4zRk/5RxzST04MThFlgxJPwCaluSmVpJu7fSY4 68k45/toUB0wm45X45GQb8BgVvjW1OzkDlYqMCbY46zRvOoLUE8krplj/jfu1WJaGCMA m1tAkQpEp/2qG2NI4uH6EQCFbC8Il4ko5D63VpumVHJnn9pvx8/8Qry4IY649103au32 1yRRtQnFzLh2F/UnEtVEm1S8U6S0AM8EpHX/2c43XgPHaQ1acVmI/aCxN/O5lPmcxiHh LZ+CV0YwfSICRPXX1xqMh8CqBTxX8O4VkCysmzqcip9EdcWUkBS8GU+iNMzvwS0QIJG9 HOIw== X-Gm-Message-State: AOAM530njFLITVYsb0v7Vjd21HjZA45vM6aDPJ3+qiF17FjuXe808gda QrJJ63mrzgW+kyVIlZh4kxRfUEextxj+BbesMbcbpg== X-Received: by 2002:a02:7817:: with SMTP id p23mr8086846jac.57.1599475567555; Mon, 07 Sep 2020 03:46:07 -0700 (PDT) MIME-Version: 1.0 References: <20200904154547.3836-1-brgl@bgdev.pl> <20200904154547.3836-24-brgl@bgdev.pl> <26ea1683-da8f-30e7-f004-3616e96d56b3@infradead.org> In-Reply-To: <26ea1683-da8f-30e7-f004-3616e96d56b3@infradead.org> From: Bartosz Golaszewski Date: Mon, 7 Sep 2020 12:45:56 +0200 Message-ID: Subject: Re: [PATCH 23/23] Documentation: gpio: add documentation for gpio-mockup To: Randy Dunlap Cc: Linus Walleij , Jonathan Corbet , Mika Westerberg , Andy Shevchenko , Kent Gibson , "open list:GPIO SUBSYSTEM" , linux-doc , Linux Kernel Mailing List , linux-acpi@vger.kernel.org, Bartosz Golaszewski , Greg Kroah-Hartman 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 On Sat, Sep 5, 2020 at 5:16 AM Randy Dunlap wrote: > > Hi, > > On 9/4/20 8:45 AM, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > There's some documentation for gpio-mockup's debugfs interface in the > > driver's source but it's not much. Add proper documentation for this > > testing module. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > .../admin-guide/gpio/gpio-mockup.rst | 87 +++++++++++++++++++ > > 1 file changed, 87 insertions(+) > > create mode 100644 Documentation/admin-guide/gpio/gpio-mockup.rst > > > > diff --git a/Documentation/admin-guide/gpio/gpio-mockup.rst b/Documentation/admin-guide/gpio/gpio-mockup.rst > > new file mode 100644 > > index 000000000000..1d452ee55f8d > > --- /dev/null > > +++ b/Documentation/admin-guide/gpio/gpio-mockup.rst > > @@ -0,0 +1,87 @@ > > +.. SPDX-License-Identifier: GPL-2.0-only > > + > > +GPIO Testing Driver > > +=================== > > + > > +The GPIO Testing Driver (gpio-mockup) provides a way to create simulated GPIO > > +chips for testing purposes. There are two ways of configuring the chips exposed > > +by the module. The lines can be accessed using the standard GPIO character > > +device interface as well as manipulated using the dedicated debugfs directory > > +structure. > > Could configfs be used for this instead of debugfs? > debugfs is ad hoc. > > > + > > +Creating simulated chips using debugfs > > +-------------------------------------- > > + > > +When the gpio-mockup module is loaded (or builtin) it creates its own directory > > +in debugfs. Assuming debugfs is mounted at /sys/kernel/debug/, the directory > > +will be located at /sys/kernel/debug/gpio-mockup/. Inside this directory there > > +are two attributes: new_device and delete_device. > > + > > +New chips can be created by writing a single line containing a number of > > +options to "new_device". For example: > > + > > +.. code-block:: sh > > + > > + $ echo "label=my-mockup num_lines=4 named_lines" > /sys/kernel/debug/gpio-mockup/new_device > > + > > +Supported options: > > + > > + num_lines= - number of GPIO lines to expose > > + > > + label=