From patchwork Fri Sep 4 15:45:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 293552 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=-13.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 566AEC433E2 for ; Fri, 4 Sep 2020 15:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29474206E7 for ; Fri, 4 Sep 2020 15:47:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="iirBcZw4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727792AbgIDPr4 (ORCPT ); Fri, 4 Sep 2020 11:47:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbgIDPrg (ORCPT ); Fri, 4 Sep 2020 11:47:36 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936C4C061246 for ; Fri, 4 Sep 2020 08:46:59 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id w2so6507364wmi.1 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=GBSRAaS1i0yGNkRfXQ46ONAF6WSmW/FqLNhN+6CUb4lUFD4YKrUWLl0tE47QTVHHeY PTGKPosRmGAXLIM8Fvt4fJWBfCTcWViY0+bscDtSgbffAI8QaE1B1GrdFbMnOsYjqjzw b7XKvAAsCt8Zaxg+tpjhKAsT1gACq/gNjqApQywumjw5YnoOLQuX0mFEkSe7lAKt4P6y zwyUj5LMokmelN1DanEFncPnL4KN/E//ZJcuqlZmWCbvTIBFudL1xPIwiYfLH/7oh2zX OYYdkV8GQdVxSHPMw3XLEzWR5yhhIJi6369QBdstE8gfwbgE2UI39c8gP8FplVtYSF91 zhZw== X-Gm-Message-State: AOAM533qXiOD0fTApcZHHGPr0/Va2K+oYaq0Ad2uzrOCWMCatV1xQNLc aA3Vly5V9XQBgnP7I7Hp+5lrpg== X-Google-Smtp-Source: ABdhPJyjc2MlVjuY6G3UNUTfVft9wTllA8VYq1OpvEDtNds22hkn1ilbEsjGyby0vTpaSIVU2cgT8Q== 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 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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=