Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1774812pxk; Fri, 4 Sep 2020 20:18:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNR0b6NrpCITLYBJrgBNXICyvmHcNJLnRsTc++zSv8lwhgYgUnxjpoeC4LmKQi7wNe22OF X-Received: by 2002:a17:906:dbe6:: with SMTP id yd6mr4360147ejb.120.1599275900174; Fri, 04 Sep 2020 20:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599275900; cv=none; d=google.com; s=arc-20160816; b=cquGa1glo6ryd3knl66a6rvv1Op21s5HvuHQBYjyyEeaEVdTP4To7v2XfbmO+aBfuu Sje4WLuAYg/tkq3F2N0X9be0LUuDlwMw7iVxFPPEx6eUpjcJL6egV5lP1R2ap8m7+IPQ 4ZokXz5PqwtBefQlQgqNOki151HCP2Ca/6/aN1Z97ovxMeW2FLhnaMHAHKtuagZXcK0Y /BptejAgeRNnudsT44d7Lmfi2HyycI9RIKDRiiTPTd7IJ5JQGrCNHN1RCdVry4zvPcfn KSaQ/t1x3ZETIb74jxRMvvX752nH6HxqDYZU+c/41BdPnjR2x/lIpV+G+bA5J2won3Y2 nrwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=hzcswmMwNT559dhICIggfDQsKXgz2tnBEKWAXq1CvMk=; b=oXVb5KhZCSc/mONyPoJZ9J+2WtDiRLbEqEwtz76SW9G+RpaXXdar4AuhQd7YSBvldn S3ScO86Msa0AlxufBYAMJxwTkJ2qnJ/zCRB075eCkY4mdWtvU6F5w4VrWQcWBPEkKkez Ax4k/lU9hXu1SbjakBvHODUVsplgSz6XFwsuz+C+NFzQoVy941mOBBmZwSLQf3pHXlqy Srp5sbRnvUVsnvk5jWUMsMR/MzcNL81mnajjFzicogQMIRlxRhtarSnfhmHReBmPJXr8 117m7hOpIFzvaASNkGpEO6u2GFIJDwTLVZ48Khh4Qy/BjSuiwwLLOx/D6B3qWA/RSQ3a fmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=EbPjQKy5; 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 cc19si6869517edb.488.2020.09.04.20.17.42; Fri, 04 Sep 2020 20:18:20 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=EbPjQKy5; 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 S1726948AbgIEDQO (ORCPT + 99 others); Fri, 4 Sep 2020 23:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbgIEDQO (ORCPT ); Fri, 4 Sep 2020 23:16:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57646C061244; Fri, 4 Sep 2020 20:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=hzcswmMwNT559dhICIggfDQsKXgz2tnBEKWAXq1CvMk=; b=EbPjQKy5mHuEsRvHD0LtSju15w e/POC6OtiTd1jGuxH1WfatomtddnS4izVIfMw4H7ouCTmd8YCzYovYM/hDgKKtLpmGK1aQUzEMfqB ubipMtPQPfHcknIORAAyBQWzbiZnBOmQ1L9ujgYEmrcjuLii5bb1uHyGMPshwQANL3vk1eDVMiBBL N1bwF2asqr7X7j9AJst6mllFwwCySdPeKyNKjLL1OLt6vpsQTe1suGXGgFv/RqBoGLSi5DwqiyIBj sjD/8VNv61TTlqDto46NALwdTuTz0glQPDLcZXZNRntCUjHjwvGJhMOlT04F0gay9iBeF29i0awXB fX5Mrh0g==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEOgQ-0001Ei-9v; Sat, 05 Sep 2020 03:16:07 +0000 Subject: Re: [PATCH 23/23] Documentation: gpio: add documentation for gpio-mockup To: Bartosz Golaszewski , Linus Walleij , Jonathan Corbet , Mika Westerberg , Andy Shevchenko , Kent Gibson Cc: linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Bartosz Golaszewski , Greg Kroah-Hartman References: <20200904154547.3836-1-brgl@bgdev.pl> <20200904154547.3836-24-brgl@bgdev.pl> From: Randy Dunlap Message-ID: <26ea1683-da8f-30e7-f004-3616e96d56b3@infradead.org> Date: Fri, 4 Sep 2020 20:15:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200904154547.3836-24-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=