Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3109473pxu; Sat, 19 Dec 2020 12:22:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyd0YT6Tkg0+P5pAOd/qc3FZqHn2VfDSWr+C85o/l6UDEvNdgm32Ro3OTbkS6pMAXkj8RJM X-Received: by 2002:a17:906:8051:: with SMTP id x17mr9436566ejw.430.1608409335135; Sat, 19 Dec 2020 12:22:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608409335; cv=none; d=google.com; s=arc-20160816; b=xfNjyr5B5To6oZiCLnPj4pQhuShOEz6TrOtwYva/9hd+ACK4UJ6mfKInNxWy6IZYU9 ZJNdE3FOOx+orGLP7v+G/u0BjPWyeJgSSoaWwN+pv8I2EdMTYVqF4CPtYwbXUyJZc9hv kXmN37c1hpW78cefVXMZhX+GWLo1AegHGceFKVWmDE1s5ZVefgSuPX9d4cRStUR7j9HM 75b7swy/fmcjd0BWhx7+LHlcTeEAoTunC+lAQtBZoAO5dwclDPwB+UVWjwC1xWbrqQsn pFyYpyXOKAJJ54qWrvRxR4oD71U5Qw6D/0lMkLuEY1IJvBWdC/NyowSXqjucF/GDyu3z sSrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tKCl0hm0vvH+bc+bs6mggnl10AKwI3SRXVyRLi1L6B0=; b=jEpWsMkaGbG/yVvTOwcMm/IDIej1L210/I7YmY8qkS6z/bEBlDVVqQLG3Om5h4HxqH srKm3tvdT/XNC0hosuMmMbinyGlu+7grubQf4GHXiDH6aB7mh2ija7Kg4XvnBcRh2Mzu MiQq+BgaBRHtp5NKyJ8xy+qDjjB7jcErJaXB4nZcwCs7Z7FqDH8+taAdlK7mnPd4sarm 9wK0nvxZ8E5UOQP9ilycG/K9bMVSpBh/aDoW8Yu7hTmRqHY1Bql00GvRaJoOxZlmiD8H PIr/IGpyNfV6SxWLhrFyck7G9f6+uD10FAU2RAk9eH7p+iy8aRSiSBNEyrRacKAjFFH6 M5bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=YkElHEyK; 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 o14si6169166eja.222.2020.12.19.12.21.37; Sat, 19 Dec 2020 12:22:15 -0800 (PST) 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=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=YkElHEyK; 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 S1727525AbgLSUTe (ORCPT + 99 others); Sat, 19 Dec 2020 15:19:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgLSUTd (ORCPT ); Sat, 19 Dec 2020 15:19:33 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A3E5C0617B0 for ; Sat, 19 Dec 2020 12:18:51 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id r5so5827490eda.12 for ; Sat, 19 Dec 2020 12:18:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tKCl0hm0vvH+bc+bs6mggnl10AKwI3SRXVyRLi1L6B0=; b=YkElHEyKIBezI2/M0lST03n4UaWAm+ZaGQtYuFO/ZLe6P8I4ePURUmGxXR4/v98UsM 7bO8WF5a/2AzFsxnJMxy/eXfOwKvHzss6OI/TzUw6669P3OY7NpYN8ybfz8a+Cg7FG/J 5WKhi7Y4B5ooPa4aBEV+8jv1QEE7Iq3blQveKUqPFkw7P758qToOX4lDIx0TAZmEHxoq y3utvAIUWihjq4MLQoOMVP6lFBtv29vY+y0o0faBgJM7VowajCXuk1ncUrTgL7lKROuD fJZq1ONhrvkRf9CdEDKqEOFM1f+DXnrMjVVdYbt3O0g1Gt35SvKLxbrikDxfwrdwwAdl HQZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tKCl0hm0vvH+bc+bs6mggnl10AKwI3SRXVyRLi1L6B0=; b=sD94Fd+9bc4PQr+Z59f56gFp7PzELuHTls7I0nPx1o/drwf3gXpLTeg5g7qEpXFfAF lmZVt2q6Tto7ZyK7oTGoCOzqxDkEvMMtzTPn7iahHGzbd7LYepqWWF+Q78Xkeywl0N6W BreAO0YR/yMhTimP8SihxnNGpq6zrR47IuXAsWm0YwYOtF70GaPpm5gwGIU50+2c4/N3 PPPADN9m/5nG+YFkzNM0do6jFy/CsqgBC79uXPITuTyjw4p0mzv/qBStTgLAxcWs82xN BfFX45LS2GXMuy14KmMayLi+G74aZ6Ld/pWt+eb30ihRNWzvS7DjBG73gN6hqXqd0QUj vuvQ== X-Gm-Message-State: AOAM531gGGRVftJ3/A2lfY3YqDu/LV50jWGDvvgN73AUQhoWKabCcSm4 PzQ6xANUEha5nR9h9HuYv7/ktw== X-Received: by 2002:aa7:d74d:: with SMTP id a13mr10243116eds.78.1608409129551; Sat, 19 Dec 2020 12:18:49 -0800 (PST) Received: from x1 ([37.235.97.56]) by smtp.gmail.com with ESMTPSA id lr24sm7163904ejb.41.2020.12.19.12.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 12:18:48 -0800 (PST) Date: Sat, 19 Dec 2020 12:18:42 -0800 From: Drew Fustini To: Andy Shevchenko Cc: "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linus Walleij , Tony Lindgren Subject: Re: [RFC PATCH] pinctrl: add helper to expose pinctrl state in debugfs Message-ID: <20201219201842.GA30242@x1> References: <20201211042625.129255-1-drew@beagleboard.org> <20201211234304.GA189853@x1> <20201214214419.GA1196223@x1> <20201215224212.GB2086329@x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2020 at 06:00:49PM +0200, Andy Shevchenko wrote: > On Wed, Dec 16, 2020 at 12:42 AM Drew Fustini wrote: > > On Tue, Dec 15, 2020 at 09:39:18PM +0200, Andy Shevchenko wrote: > > > On Tue, Dec 15, 2020 at 9:36 PM Andy Shevchenko > > > wrote: > > > > On Mon, Dec 14, 2020 at 11:44 PM Drew Fustini wrote: > > > > > On Mon, Dec 14, 2020 at 07:55:12PM +0200, Andy Shevchenko wrote: > > > > > > ... > > > > > > > > With regards to parent directory, I did discover there is > > > > > debugfs_lookup(), so I can get the dentry for "pinctrl" and create new > > > > > subdirectory inside of it. This is the structure now: > > > > > > > > > > /sys/kernel/debug/pinctrl/pinctrl_state/ocp:P2_35_pinmux/state > > > > > /sys/kernel/debug/pinctrl/pinctrl_state/ocp:P2_34_pinmux/state > > > > > /sys/kernel/debug/pinctrl/pinctrl_state/ocp:P2_33_pinmux/state > > > > > /sys/kernel/debug/pinctrl/pinctrl_state/ocp:P2_32_pinmux/state > > > > > etc.. > > > > > > Missed part to comment. > > > > > > I was talking about > > > > > > /sys/kernel/debug/pinctrl/<$PINCTRL>/mux/<$PIN> (maybe folder, maybe node) > > > > Thanks for the example. > > > > What would the value be "<$PINCTRL>"? The name of the driver? > > The name of the device instance. This is already done in the pin control code. Ah, so for the BeagleBone, that would be 44e10800.pinmux-pinctrl-single: /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/ > > > The "ocp:Px_yy_pinmux" directory name comes from dev_name(dev). Is that > > the name you were referencing in "<$PIN>"? > > No, the <$PIN> is an actual pin on this controller. However, I think > we probably don't need this, just supply it as tuple of the parameters > to be set: like > echo $PIN $STATE > .../<$PINCTRL>/mux or alike. Do you mean not having a debugfs file for each pin, but instead just using the existing combined file? /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pinmux-pins There is one line in there for each pin in the pinctrl-single instance. For example: pin 105 (PIN105): ocp:P2_34_pinmux (GPIO UNCLAIMED) function pinmux_P2_34_default_pin group pinmux_P2_34_default_pin So maybe one solution to changing pinctrl state could to: echo "105 gpio_pu" > /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pinmux-pins I'll make an attempt at implementing that. > > -- > With Best Regards, > Andy Shevchenko