From patchwork Tue Feb 16 22:44:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 383472 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 8C2EDC433DB for ; Tue, 16 Feb 2021 22:46:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3879564E68 for ; Tue, 16 Feb 2021 22:46:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbhBPWq0 (ORCPT ); Tue, 16 Feb 2021 17:46:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbhBPWqY (ORCPT ); Tue, 16 Feb 2021 17:46:24 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FD56C0613D6 for ; Tue, 16 Feb 2021 14:45:43 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id o63so7206055pgo.6 for ; Tue, 16 Feb 2021 14:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=crc+oaPBwmJLuhdzYhxtkJDRIfu/BQGupIafKHnaRI8=; b=NgI7gJ4JI1UkXnfzOj1d5e0puXKF0CFg5Ngwr26Ty+v0cMPjzuLPsHdrG1oxucrm3j +qDzFszW5aAftxhA+MBdTDgM0RhSVHxeOfUOpfzqA1QVD1pNsY1qK9R8vC/HKQsbBfkJ Ru8buAsLA7VJWd14gjMPRtG5p88u5VX9ARV6LlxCMRFC5c2Gnz+7CEUV4gnMpjLE6znV 4j4wQ9Zqf7+K3uhBo/3pfZogIoxFC3kKCz2LQkJ1z4obiPElkq3MCMNuS37Q3jLRVBTF YgObZYAintFp3QgQs5m/9Tp/PPcKg+7OUd56e/X8nEKmLlr/elq34Jwm58W25pMhvP9J w81Q== 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=crc+oaPBwmJLuhdzYhxtkJDRIfu/BQGupIafKHnaRI8=; b=FJ+HwIfhnLwjaJUVIF/CaDq6tfQStvSldMm1XV3VoGY0281YrnmKAvqIDo4L09uuDj 12MWj0XdEqypy9dJteZuMthP308tHrdap/mDofqjuYk6rBFeVSj6OfnRx+gr+6BWLjDY V1lqZZ592X7LTP20XfOaDLddxEcQUhn8QH9J8LGTcdOlbp8cIFkCaZlP93blCOjUQA+q AlB+qZeffXr8VGebYHnQNBEeo7N3GxkP+k01M5filmD7yMLK1a86h0fGMDk0PD3zRHSd lDXMv8Ie26w8bnXvIpUH9t3cF4cSju86ZyCTjuGduSN4uEbEvghy4d8m8EW2vxcclUlQ p/TA== X-Gm-Message-State: AOAM530a/qx1tC8i4qIqAiWmXOIVSLm1MNvHhiPCaWTEvdwGPv7ikcri zsxanexQfZbq6et0b+srLJN49w== X-Google-Smtp-Source: ABdhPJxLnXNsoWH1JjMoI3/wIgr2kpc3vJgMQ2414V+PTKVmYjyIGY60cN5fpVQ5AXErrjL6rdRVNA== X-Received: by 2002:a63:2b82:: with SMTP id r124mr21093120pgr.310.1613515542849; Tue, 16 Feb 2021 14:45:42 -0800 (PST) Received: from x1.hsd1.or.comcast.net ([2601:1c0:4701:ae70:4e06:8d2c:6f9:5b31]) by smtp.gmail.com with ESMTPSA id 184sm1922465pfc.176.2021.02.16.14.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 14:45:42 -0800 (PST) From: Drew Fustini To: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lindgren , Andy Shevchenko , Alexandre Belloni , Geert Uytterhoeven , Pantelis Antoniou , Jason Kridner , Robert Nelson , Joe Perches , Dan Carpenter , Jonathan Corbet , linux-doc@vger.kernel.org Cc: Drew Fustini , Geert Uytterhoeven Subject: [PATCH v6 1/3] pinctrl: use to octal permissions for debugfs files Date: Tue, 16 Feb 2021 14:44:53 -0800 Message-Id: <20210216224455.1504008-2-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210216224455.1504008-1-drew@beagleboard.org> References: <20210216224455.1504008-1-drew@beagleboard.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Switch over pinctrl debugfs files to use octal permissions as they are preferred over symbolic permissions. Refer to commit f90774e1fd27 ("checkpatch: look for symbolic permissions and suggest octal instead"). Note: S_IFREG flag is added to the mode by __debugfs_create_file() in fs/debugfs/inode.c Suggested-by: Joe Perches Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Signed-off-by: Drew Fustini --- drivers/pinctrl/core.c | 12 ++++++------ drivers/pinctrl/pinconf.c | 4 ++-- drivers/pinctrl/pinmux.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 3663d87f51a0..07458742bc0f 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -1888,11 +1888,11 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) dev_name(pctldev->dev)); return; } - debugfs_create_file("pins", S_IFREG | S_IRUGO, + debugfs_create_file("pins", 0444, device_root, pctldev, &pinctrl_pins_fops); - debugfs_create_file("pingroups", S_IFREG | S_IRUGO, + debugfs_create_file("pingroups", 0444, device_root, pctldev, &pinctrl_groups_fops); - debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, + debugfs_create_file("gpio-ranges", 0444, device_root, pctldev, &pinctrl_gpioranges_fops); if (pctldev->desc->pmxops) pinmux_init_device_debugfs(device_root, pctldev); @@ -1914,11 +1914,11 @@ static void pinctrl_init_debugfs(void) return; } - debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, + debugfs_create_file("pinctrl-devices", 0444, debugfs_root, NULL, &pinctrl_devices_fops); - debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO, + debugfs_create_file("pinctrl-maps", 0444, debugfs_root, NULL, &pinctrl_maps_fops); - debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO, + debugfs_create_file("pinctrl-handles", 0444, debugfs_root, NULL, &pinctrl_fops); } diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index 02c075cc010b..d9d54065472e 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c @@ -370,9 +370,9 @@ DEFINE_SHOW_ATTRIBUTE(pinconf_groups); void pinconf_init_device_debugfs(struct dentry *devroot, struct pinctrl_dev *pctldev) { - debugfs_create_file("pinconf-pins", S_IFREG | S_IRUGO, + debugfs_create_file("pinconf-pins", 0444, devroot, pctldev, &pinconf_pins_fops); - debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO, + debugfs_create_file("pinconf-groups", 0444, devroot, pctldev, &pinconf_groups_fops); } diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index bab888fe3f8e..c651b2db0925 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -676,9 +676,9 @@ DEFINE_SHOW_ATTRIBUTE(pinmux_pins); void pinmux_init_device_debugfs(struct dentry *devroot, struct pinctrl_dev *pctldev) { - debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO, + debugfs_create_file("pinmux-functions", 0444, devroot, pctldev, &pinmux_functions_fops); - debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO, + debugfs_create_file("pinmux-pins", 0444, devroot, pctldev, &pinmux_pins_fops); } From patchwork Tue Feb 16 22:44:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 383471 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 BB825C433DB for ; Tue, 16 Feb 2021 22:47:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90AAA64DFF for ; Tue, 16 Feb 2021 22:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbhBPWrH (ORCPT ); Tue, 16 Feb 2021 17:47:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbhBPWrG (ORCPT ); Tue, 16 Feb 2021 17:47:06 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFFE3C061797 for ; Tue, 16 Feb 2021 14:45:45 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id c11so7100586pfp.10 for ; Tue, 16 Feb 2021 14:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yUCiqkksgcwS9O+xvzvVuH6FNIKF3LonMA8pWP2Dk/o=; b=orlgr292I9vem0IDvmJOpJs6SBNLVNfrpFzhwaN1Gkot/mbrA68mrOr76RlJD6X9rw 5CqZPChR0zwTTBx/vpMPbn4/f6lq8bxpyY2UMMH7WPJr2j8UxfVyY0ww6B2ahz4fSbHR wMz7FmgNKHq0VaFF0jJCcXLf8YOZYKg21gtort5jToK5tZTQ6tOGFIslhtckpbuToegs vCsThY19AXW//27XCpknMpLkkaHo15WtKFRtJ2MUcbtHLrs1ETOoKqfMYBoZqRo0FrXs IJc9z/Tp2oc6F9xAJXFnly2OZMjtrtXdKtzzZcPXRrxRlJtxVUvOuLEUUOppeoosWepj THNA== 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=yUCiqkksgcwS9O+xvzvVuH6FNIKF3LonMA8pWP2Dk/o=; b=thC/nh/KAMsLZTZfariZpvBGmH0xDU7mqdf2HCtlq7TRYuMWk6fiDypwzvyHIKTMJn dzmN4FfecYPpIDIP/F+7CWLw2OeoTWDCgaK8bkBedgrpa0+83njutqDNhyuA0/HvWVN0 F0/6oZc/uXoRsZxHcMoMg2r2ivCGM0Brd8hHuK1Vpd5TiuoqG4v9KpoWNoABZ7trUM2J SXmiIgRPmFxc9zfJkkqm3ukLRnk5rsB6t2wolW24X2vqs3v5bAyqXIjuBRN/Q95kgolG burihHEHhBS5rXSfZnHw/M+9IcDgsIihFpfdSMb8tTiSLbwpzfgf0frnCr5wp1p2/RxJ boLg== X-Gm-Message-State: AOAM532igXnJR8MbRO1UXDlOhkgd2F2qhz2LmgMkNTySzplWpq/6Q9WK sgPpU6CzFHaQsJw5LTWTrb5DJA== X-Google-Smtp-Source: ABdhPJxkZYpUoubKxTZgPxZ4EIED2k5HlzFMqFCMgsFtAnQQwQYeNdRkChmrAm3rE3oif4IqhdFC4A== X-Received: by 2002:a63:f74f:: with SMTP id f15mr21089308pgk.413.1613515545548; Tue, 16 Feb 2021 14:45:45 -0800 (PST) Received: from x1.hsd1.or.comcast.net ([2601:1c0:4701:ae70:4e06:8d2c:6f9:5b31]) by smtp.gmail.com with ESMTPSA id 184sm1922465pfc.176.2021.02.16.14.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 14:45:45 -0800 (PST) From: Drew Fustini To: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lindgren , Andy Shevchenko , Alexandre Belloni , Geert Uytterhoeven , Pantelis Antoniou , Jason Kridner , Robert Nelson , Joe Perches , Dan Carpenter , Jonathan Corbet , linux-doc@vger.kernel.org Cc: Drew Fustini Subject: [PATCH v6 3/3] docs/pinctrl: document debugfs files Date: Tue, 16 Feb 2021 14:44:55 -0800 Message-Id: <20210216224455.1504008-4-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210216224455.1504008-1-drew@beagleboard.org> References: <20210216224455.1504008-1-drew@beagleboard.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Document debugfs directories and files created for pinctrl subsystem. Suggested-by: Andy Shevchenko Signed-off-by: Drew Fustini Reviewed-by: Andy Shevchenko --- Documentation/driver-api/pinctl.rst | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/driver-api/pinctl.rst b/Documentation/driver-api/pinctl.rst index 3d2deaf48841..37bc3bd64cd8 100644 --- a/Documentation/driver-api/pinctl.rst +++ b/Documentation/driver-api/pinctl.rst @@ -1428,3 +1428,40 @@ on the pins defined by group B:: The above has to be done from process context. The reservation of the pins will be done when the state is activated, so in effect one specific pin can be used by different functions at different times on a running system. + + +Debugfs files +============= +These files are created in ``/sys/kernel/debug/pinctrl``: + +- ``pinctrl-devices``: prints each pin controller device along with columns to + indicate support for pinmux and pinconf + +- ``pinctrl-handles``: iterate through the list of pin controller handles and + print the corresponding pinmux maps + +- ``pinctrl-maps``: print all pinctrl maps + +A sub-directory is created inside of ``/sys/kernel/debug/pinctrl`` for each pin +controller device containing these files: + +- ``pins``: prints a line for each pin registered on the pin controller. The + pinctrl driver may add additional information such as register contents. + +- ``gpio-ranges``: print ranges that map gpio lines to pins on the controller + +- ``pingroups``: print all pin groups registered on the pin controller + +- ``pinconf-pins``: print pin config settings for each pin + +- ``pinconf-groups``: print pin config settings per pin group + +- ``pinmux-functions``: print each pin function along with the pin groups that + map to the pin function + +- ``pinmux-pins``: iterate through all pins and print mux owner, gpio owner + and if the pin is a hog + +- ``pinmux-select``: write to this file to activate a pin function and group:: + + echo "" > pinmux-select