Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2213204pxu; Fri, 18 Dec 2020 08:02:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwo7S7K9Sac1kgrkofrDg9xapb0pliA4CqVttjLx83GEUqq536gDyEv9H+oZBfqf/1gotwS X-Received: by 2002:aa7:c886:: with SMTP id p6mr5092541eds.207.1608307368327; Fri, 18 Dec 2020 08:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608307368; cv=none; d=google.com; s=arc-20160816; b=mAvLATKSx/sXuh0hkZ1GsHGsF7x/SwiY3vt1a/6ON1wuU5iDRVqMpOxZposf7KqB9o WFFMnJTufG6/c3VNj35udpVvcXS+6W6aD1HSYWPjul86nH3M19NXE4Gf05uYvHrPaxwD IPlEkMedIi4CJ30f1savYeGY27ensXfvhONjt7mafEmXP/uG8ac1fkfSxs8zPbKHa2zG cXVJm23Rre/V70wBiPM3hEy6wwe6/zWZG/98X/7vSPOk/KAM86hhLswB315n4ZMvOjCT 1Ls0DJsU34yAt1mjS/Fvu9EWiXrolYyczbleW+fKIegu94vqtBZOPPA/bGJIP/BI4mfF j4zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=DRM/wBZDVRUf6b3umPWfvNsEtcdrtOMQW/bD+f2otgU=; b=TK16r95IY6F/oO4aDKEUrou55NZVPefJCnaF4P7xkGT9rphxsskGCL0Xk1M8bqatL1 /02oDCCsyMUevKmR0zaz4TTEQwopGdvD6l6xypPu/hQiey93y4Gymc2/y88d3fHBNF+U B5/QPysZM8dUe2v3ecl28expMiXAn5VD3WV4aZ4/2SG/IpGKkVgKKC0CRfJSk/bLC3+8 nWhXDFPwm7cmc0TqU9ovhAllHnidQcpQh7e80n08tViWcWsZ/ja0Z6PEBdIQTwG4F9XX pzrIr+XZ+8iHOPPceqODs2NMqEWVltnVgKigMOPTZNgW2TfwA6TtT8GglhTCd1aD93lk pZnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KGL6XFsh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si5236572ejo.100.2020.12.18.08.02.24; Fri, 18 Dec 2020 08:02:48 -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=@gmail.com header.s=20161025 header.b=KGL6XFsh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725982AbgLRQBr (ORCPT + 99 others); Fri, 18 Dec 2020 11:01:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbgLRQBr (ORCPT ); Fri, 18 Dec 2020 11:01:47 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61936C0617A7; Fri, 18 Dec 2020 08:01:07 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id f17so1581907pge.6; Fri, 18 Dec 2020 08:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DRM/wBZDVRUf6b3umPWfvNsEtcdrtOMQW/bD+f2otgU=; b=KGL6XFshSDIGuPnWo+jL/LRsXLpvUktlDkWZfYWi1f4v3svvLiXJ8R1RZP8NGEADuR H7CWqKSWQaOJD1avCfj0dCW2S83YVSUr4ruH8U3MWoCFCQCGALq5dKxJIiw7GNipHWId HW6H8HT9O/75yzySCljS9Vb2rRxLMo6EfRyj4VTKaTTKkf6rjOtFAVt2oyJOsQMdOetF 6kFn9MYUFlB+D3UhbA821cB5uPwoYvNCVYPusAU4ehtLlxj0YCxUvZKbCSf7UgQw9kFN RClczXzyx48+0MOH+eP7crd9TxYBJNlZ4doIYgNu3lDTvwkXbTuQfDuQblqzAYd9Uik4 TFNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DRM/wBZDVRUf6b3umPWfvNsEtcdrtOMQW/bD+f2otgU=; b=NrL2Sc0PtJfsUThNPAICuLTL0qCaDiYyt1KOpWChpoJ76YLXSEaJ9SFIOsWIl05QFq SsANO+RbCtCwkbFceAu8Kkxrd/ffHKpurkbfWXJ6Pqf3DbRsDrF4mEGHdv1mvsAdJSHZ oQMmfIR8n0YU7Q9v9ygeyzjy5JRiKqnKvS4XAdKr7k3dL3mIlP20zFSzzL2K8frbboL/ uouObV1HYOhGZ9c5rlVVjpBGoF8nlomAN6qJbmduv4dPXVL5oZwExbTJoSYYgId9ZRcN vzYKBNSEz6mP5415DJP2EA32etYTEKm6Z3g5pnm0duSVI5gcS3ESKFA8yClA0iLJPzAu 7TuA== X-Gm-Message-State: AOAM531vpTuainLYiOqtZPG4zVXtum7bo/IHZHBz3fEokKU7VHo8pQ/H PUgWVOIjLfJcoPJ6oMZScPeQx5Y0ru38NX+RYnY= X-Received: by 2002:a63:74b:: with SMTP id 72mr4772037pgh.4.1608307266722; Fri, 18 Dec 2020 08:01:06 -0800 (PST) MIME-Version: 1.0 References: <20201211042625.129255-1-drew@beagleboard.org> <20201211234304.GA189853@x1> <20201214214419.GA1196223@x1> <20201215224212.GB2086329@x1> In-Reply-To: <20201215224212.GB2086329@x1> From: Andy Shevchenko Date: Fri, 18 Dec 2020 18:00:49 +0200 Message-ID: Subject: Re: [RFC PATCH] pinctrl: add helper to expose pinctrl state in debugfs To: Drew Fustini Cc: "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linus Walleij , Tony Lindgren Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. -- With Best Regards, Andy Shevchenko