Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1414295pxk; Fri, 4 Sep 2020 08:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFuBVKHV9BajnJrQINKd4gdCeBZ5gya3eyinFFtfvLuBOTKp2jMf/8IKqHRhmnz6bHZ7C0 X-Received: by 2002:a50:e087:: with SMTP id f7mr9707461edl.174.1599234569498; Fri, 04 Sep 2020 08:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599234569; cv=none; d=google.com; s=arc-20160816; b=PmUwjnXyqw4u9MhYwUccaUpBVOnttUfyvCASCQJpr9XGlGzO3IDDHHA6XnZSE4kgvV anCSge5rAKTMgJxwr3KGXYagY4WcQag++ibgZe002Yv2xS1EtiohjbCDCLOb60NeZc+E Re8JD2z1pQGwT05gwCCG6tHCW7Omhwjz/4Mj+1Y3mTNDub7lC3XaQiBOT3AHsJRM4Vog /ba1r2+CDWMGpncVX7Lt4Nq/zkTfBGMFBEg27lFm6pBrmSG35hXde4nPXgNCZjyNj2n9 dpzxfEewIGvWFxSQkt3NhhFau8LXgC9d2QVUDfVztcpG6PPyNNdehdoN1qxrUBHxObgP 1qTA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+T4nqXaC8fjBrWkDJbcI/m89Hs0Il9eeYVZ91EUv4bE=; b=DcCi/qXmdM1pkf5DMK/e4ypHSlSlzqOjbu4rpqp1IQBBMSwACYzlW3aHs3fmcNyD73 0Pa4zwg+UD2AKMFd1sn02h1ZbifC9j9lBp4+hbG1IfABdpYC4glHtmZA95dI9GZQahVr sRh9g7kI0yR86OekrG7l/kU0ZJq7dIXbS9osGIvqdmedG2MWEwHpZ/C+6yDHInD1KSld rbCIO5gvO96dFIHYmAnHOp/2/VAHP3cJiphlb77ZSNoYiOoyjLZaC2P06fv+qMjMgcGm ElYVjmM4Mp1Jfx2w4vwGMNOtEPydtT3ZFGgBjqjqwYf0PT8gEAStUTRNdiWVfCoAXPkI tslA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=iirBcZw4; 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 u17si3993380edx.501.2020.09.04.08.49.06; Fri, 04 Sep 2020 08:49:29 -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=iirBcZw4; 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 S1727850AbgIDPsB (ORCPT + 99 others); Fri, 4 Sep 2020 11:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726927AbgIDPrf (ORCPT ); Fri, 4 Sep 2020 11:47:35 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94138C0619EB for ; Fri, 4 Sep 2020 08:46:59 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id s13so6473747wmh.4 for ; Fri, 04 Sep 2020 08:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+T4nqXaC8fjBrWkDJbcI/m89Hs0Il9eeYVZ91EUv4bE=; b=iirBcZw4EgxyAFB9yrfqfHzrbIqBRMnGr84pnWLTSHWiDS/j7p4d7c1IpfTuH6U0yE kqQ+3Cup4oeN2ka7rRGBWA1VgzzhuxJJja+zLHmjZw2eXRU3Yosp3+5A4U7XPXJ5vbVj B0EwMLnRv8Z1xZQRMOZVAeXAcgdCFJ6591m6BtMaR7vygL5ntSU++35wP4FwhLKD8mki n4OL3b5QGP86X4QLHPRhSu46PuWJoc+QP4LeR4B2yVVJitaWtbOymwB3MJF/uM5Vx81y RLijD9+Rt/EUhWQrtLvqh/+1KBK6+11K8JaHcwSvMvX79X8NocXKzJGbiecv0fBZjslV A7vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+T4nqXaC8fjBrWkDJbcI/m89Hs0Il9eeYVZ91EUv4bE=; b=oz99CJO6ncHyYF3WzWsq/vr05+5VYICoddVqjKDW9lTNxKDKf+/YM7W7D4l85Lozrk cex9J/wNvn9zMbGTV7W4ko7KpGtklofuF6vFOW67JsbeN47tRCEuG9wvFR9tpM81Bt/b praIYTJmjWzHolHGKptPPEPw4k8LnpPHvScBcVWR5Y2OOf2sv50//8Z3wL6ykCnqU9IT QRbOlUAuKkYtl2coegGLinhpMvC4Alr4uoiEUgkZnCVK2GMYs9xHyzO/htac56vym0WN n1n4VoQi9HE8sDZ+sCd7XdrIaQ+sX/fqsSggEkFC/6NfMEi7oe88ftftE34rFXtxRoi7 +fTQ== X-Gm-Message-State: AOAM530J5p8DOHCFoDCdMpY04l84eZyTY09Rz/NgVs3L19V16Dtxmszg HK3Yfvr6eoaw3Xe8U5ry70dTMA== X-Received: by 2002:a7b:cb0d:: with SMTP id u13mr8555846wmj.144.1599234418241; Fri, 04 Sep 2020 08:46:58 -0700 (PDT) Received: from debian-brgl.home (lfbn-nic-1-68-20.w2-15.abo.wanadoo.fr. [2.15.159.20]) by smtp.gmail.com with ESMTPSA id q4sm11983375wru.65.2020.09.04.08.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 08:46:57 -0700 (PDT) From: Bartosz Golaszewski To: 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 Subject: [PATCH 23/23] Documentation: gpio: add documentation for gpio-mockup Date: Fri, 4 Sep 2020 17:45:47 +0200 Message-Id: <20200904154547.3836-24-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200904154547.3836-1-brgl@bgdev.pl> References: <20200904154547.3836-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. + +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=