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=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 B8036C2D0A8 for ; Fri, 4 Sep 2020 16:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 851432073B for ; Fri, 4 Sep 2020 16:58:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbgIDQ6Y (ORCPT ); Fri, 4 Sep 2020 12:58:24 -0400 Received: from mga12.intel.com ([192.55.52.136]:24022 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbgIDQ6X (ORCPT ); Fri, 4 Sep 2020 12:58:23 -0400 IronPort-SDR: tatuHcS13egl3yMQnSDNoVHfGTO89+Qc1/ov3jcoVv/pj2pfErKyLj+PpZOR+7FeZweptN4IS6 87jzFKEszLAg== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137306594" X-IronPort-AV: E=Sophos;i="5.76,390,1592895600"; d="scan'208";a="137306594" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 09:58:22 -0700 IronPort-SDR: fvIQqyvpT+8yq4ky+Ofmsp7u5g5tPOzdE5X3ikAlRFUuNGZ4MVaa4Sjn5kvRR59sGSJ9/RIvfD tYSes7oXVgVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,390,1592895600"; d="scan'208";a="332221166" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008.jf.intel.com with ESMTP; 04 Sep 2020 09:58:19 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kEF2W-00EKWv-Rn; Fri, 04 Sep 2020 19:58:16 +0300 Date: Fri, 4 Sep 2020 19:58:16 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Jonathan Corbet , Mika Westerberg , Kent Gibson , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 23/23] Documentation: gpio: add documentation for gpio-mockup Message-ID: <20200904165816.GF1891694@smile.fi.intel.com> References: <20200904154547.3836-1-brgl@bgdev.pl> <20200904154547.3836-24-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904154547.3836-24-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 05:45:47PM +0200, 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. I always for the documentation! > 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. > + > +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=