Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1591807pxu; Sat, 12 Dec 2020 19:14:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8cEvnupM3pbrZZ/xt7gv2QoXBAXFQs9V48lgABPQwEF3byn3LkyEnsn6V0GEA5fY0yOZO X-Received: by 2002:a50:ee11:: with SMTP id g17mr19712823eds.259.1607829299514; Sat, 12 Dec 2020 19:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607829299; cv=none; d=google.com; s=arc-20160816; b=a85qdVEdG9jzTvOglr3yYPkzFcOhihq72mD/SWDUJQ0ktW1jYmDXyzqkVs+ayhw2Vq PEmcL+HlLQVc3dEaCAWNZsra5Oq/NLMuhtL45M/m2rAYpW6wjLMzIXRLAo5es0U7BEnM ud0lclia0XxO1Ilm5nEo5n3KbdBPWI8ZI39R67lULqgfdt33cvtOKfjPnffuC9w9H+Es H+lg+1p+xXW0OOTMEq99IulvmxghvCExxAo24XKtRYPzjfxzzuzOqXDV+KvyMWV3RI/b MWAxjLlmMOIApWiQcU2nHdOebhp+9E6URzldITCtsR6R0pJNjmRtRSB1gthVk0P7ZNK2 XPNQ== 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=ZAqTN7N4s0ZVaTdEPOvyAv38va5XxW6WW67wTQBqGtA=; b=mvEOOiEpu2e/u7aeTdukAuVVn/cbiKTGuVIKfemI63YPPi8wqehBtcW9IV4RVhdH6R l2Z+2uYpi3zLpPMllFX1uDfzaIOcea753hZDLMh2jax3QQQwM5c2RtCSPVsPYUQQHIBT +Pl/H5n6KXc7WQcxcMkt6icTXtUKGxpb+IHz0PKNN8SGjSZks4voGF4lZ3vGvcLCn+UX nOFZU4VY0Jp0YOCth09UDoQsv15fgwrZhmK0j6Aubt76zU5Zh4OSWoKuMPb3Ssdc3lUC 2ORYS/s6u1TogqqUwZgGczvXV8BOK8D8g0W5xucnrkXWkpGjVRcouQovVM05F+jAQ2oE HCpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fh8vsjet; 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 hs9si7226215ejc.187.2020.12.12.19.14.37; Sat, 12 Dec 2020 19:14:59 -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=fh8vsjet; 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 S2389033AbgLKVQs (ORCPT + 99 others); Fri, 11 Dec 2020 16:16:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbgLKVQT (ORCPT ); Fri, 11 Dec 2020 16:16:19 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D7A0C0613D3; Fri, 11 Dec 2020 13:15:39 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id t6so5228607plq.1; Fri, 11 Dec 2020 13:15:39 -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=ZAqTN7N4s0ZVaTdEPOvyAv38va5XxW6WW67wTQBqGtA=; b=fh8vsjetqBmGgt2HnPCppc+aTWU9zdYuewDF62lfABoiTULIOgkY7VcNDHtzOc+yPu X0+TbboHlf1+YHJu26LbOsmZoKwLD1Jdmo0lAwe1mvggIuxHgO2gB5IuzVg0D9OGtoJk 299rjy1oz5tCux8CmbrEQe7EkVd4bpUgmyUrepKTw+D3tZo/LDpvD0Tb0ZPh1Um7BM2W XL3WJl0o4axyesDjSDopkI+l6UK9bZWpCmA+L2Poo3lde3ty4aNXu9IYgrujxcq7Nd65 P7hluddTs9WxONybduqmdr/93uvpDsEhyh7tzNBg6eJTydOyajsAJIDtgQeXiI5hC8vO xLug== 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=ZAqTN7N4s0ZVaTdEPOvyAv38va5XxW6WW67wTQBqGtA=; b=c331EQZ20PMkZYROoVepXVyxmOjU66gwTPa3bkQ8LZiTUOg9EyZKUwiq1BWdRLC7P8 cedC9tKxMxRUU0+9k/nNUmHo4j9eKqNBZ/tCUg0eKaH5uPU6kdSskAe3WqB44kGqKf3v 9+aXthHqfYMgKgL1DKbd0KYSQG+ljjqt/DmyoeomtqlbC0thXzjQP9Aba/z+4EZyRvNz fn8YopsnurPm3RAVTVznnhTab2h3TMpY8wxlX7NtRrq+EKata8zz2Kg/j62jANPRowDT NuVMNE0/gniFfQfrwFgfhWAmyHD57e1xIGeaROzxkO01UhJOPcFcThqxrbo1jXLWfY+l /PSQ== X-Gm-Message-State: AOAM532qxEYzIUzEp9noda0P+EQ4z8jeRWoURV+ENs/njolPQavopcrQ FuBuN5naBhih32nZ0Y51JRiPeEnAxroMe00PUbc= X-Received: by 2002:a17:902:e98c:b029:da:cb88:f11d with SMTP id f12-20020a170902e98cb02900dacb88f11dmr12535178plb.17.1607721339002; Fri, 11 Dec 2020 13:15:39 -0800 (PST) MIME-Version: 1.0 References: <20201211042625.129255-1-drew@beagleboard.org> In-Reply-To: <20201211042625.129255-1-drew@beagleboard.org> From: Andy Shevchenko Date: Fri, 11 Dec 2020 23:15:21 +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 , Pantelis Antoniou , Linus Walleij , Tony Lindgren Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 11, 2020 at 1:54 PM Drew Fustini wrote: > > BeagleBoard.org [0] currently uses an out-of-tree driver called > bone-pinmux-helper [1] developed by Pantelis Antoniou [2] back in 2013. And it looks like it's still using APIs from 2013. Needs quite a clean up. > The driver assists users of our BeagleBone and PocketBeagle boards in > rapid prototyping by allowing them to change at run-time between defined > set of pinctrl states [3] for each pin on the expansion connectors [4]. > This is achieved by exposing a 'state' file in sysfs for each pin which > is used by our 'config-pin' utility [5]. > > Our goal is to eliminate all out-of-tree drivers for BeagleBoard.org > boards and thus I have been working to replace bone-pinmux-helper with a > new driver that could be acceptable upstream. My understanding is that > debugfs, unlike sysfs, could be the appropriate mechanism to expose such > functionality. Yeah, for debugfs we don't require too much and esp. there is no requirement to keep backward compatibility thru interface. I.o.w. it's *not* an ABI. ... > I used the compatible string "pinctrl,state-helper" but would appreciate > advice on how to best name this. Should I create a new vendor prefix? Since it's BB specific, it should have file name and compatible string accordingly. But I'm wondering, why it requires this kind of thing and can't be simply always part of the kernel based on configuration option? > The P9_14_pinmux entry would cause pinctrl-state-helper to be probed. > The driver would create the corresponding pinctrl state file in debugfs > for the pin. Here is an example of how the state can be read and > written from userspace: > > root@beaglebone:~# cat /sys/kernel/debug/ocp\:P9_14_pinmux/state > default > root@beaglebone:~# echo pwm > /sys/kernel/debug/ocp\:P9_14_pinmux/state > root@beaglebone:~# cat /sys/kernel/debug/ocp\:P9_14_pinmux/state > pwm Shouldn't it be rather a part of a certain pin control folder: debug/pinctrl/.../mux/... ? > I would very much appreciate feedback on both this general concept, and > also specific areas in which the code should be changed to be acceptable > upstream. I will give time for more discussion about concepts and so, because code (as stated above) is quite old and requires a lot of cleaning up. -- With Best Regards, Andy Shevchenko