Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2031332pxj; Wed, 19 May 2021 21:18:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2FEnY+arNF/UlUSL224v1ejeochnsexlBrQSTvd26Iko5GHmiguJmBsyNTM9h7o2HlmWn X-Received: by 2002:a17:906:68c:: with SMTP id u12mr2580185ejb.470.1621484330981; Wed, 19 May 2021 21:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621484330; cv=none; d=google.com; s=arc-20160816; b=x6LQWqOYJoUX3Es9Suj+4amsHJo9TQ3PWGLr7UPDMLcf4CQ2TfRrVVHWVvEsLgC3j0 v5F5K78P4Px7/SnelAUrqUp+GR8oSwRhJJQo6YFvH6bDy8ZLfhNWbFiRzIE7zO2cCzRe /ZoTRjNubbqneeGxM7gJhH0mYfnAGMkISKshnhqAIXjvP7NbwEP+DxW4aaCP04xhiRZ3 B8eHAjJgFAJaXhsQv2cxIIbZwe+3wzJbkasuJurvJjrA+woWTs2vAy49NaJBP3ZAs6lG Gnun+0vRgZasigyq3p0eEivRr1MaIEcG6kOGxQSTvnIdzH+X77BEI2WeeXCHXLZespSU M5wQ== 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=vSAhZlU3cc1f6R2gciMFVwjz3Y0xmsU0eN+/yBhrwpg=; b=fdejPqpOHnFNipmmU2SY98zsBNsBFbe5QOoe59lADHDgtffhEoU9YVKXaeeuwZNVV9 AMlsIpnUVcPwxXveDIHyCL/tDFRAeRoicwlXfh8rBz9mlyryBubOsZmPFnSdansMBY19 oKdtT/w+IcIDjJP2lnx8WSlMG5bv3oF69RqlJvrLyw25qCkjFMn7O1RsRbE53cuCHMvY kjMZmGj8iui1Vz0JXlaIVvppA/w9GUaqwrn9IIqIZX38OiXmAI+75MKEPHtPmtQTsR/m +yATf+4zPuDtoJZvWJp1QHsEvGVtUPojaQclgrFKHrxL+Qy6EoaLHNuoKchKIraEj3SI FeIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=0mpN1Fai; 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 f21si1089073edr.304.2021.05.19.21.18.27; Wed, 19 May 2021 21:18:50 -0700 (PDT) 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=0mpN1Fai; 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 S229534AbhETES7 (ORCPT + 99 others); Thu, 20 May 2021 00:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhETES6 (ORCPT ); Thu, 20 May 2021 00:18:58 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D9C1C06175F for ; Wed, 19 May 2021 21:17:36 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id gb21-20020a17090b0615b029015d1a863a91so4731999pjb.2 for ; Wed, 19 May 2021 21:17:36 -0700 (PDT) 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=vSAhZlU3cc1f6R2gciMFVwjz3Y0xmsU0eN+/yBhrwpg=; b=0mpN1Faim4HtKeNt6TXGKV0MLs4V1OI1LaBLltG6s635DQj0Z2aN3x8Kj7Q/yk77CS 7ljPE3+EYFnL8m99Y52+e8bAywN75Js1Kkcf1/tfjMfPxAtFWt29XsWJh80nt2AOmIE8 QsSH2SeYrE+1O6/FbThzgIS9mBU6sLOif1wensg5FuQZ6kl12MvGeLDKAB/+8WeLxGDS jYa7eGR1cXMqwibtdUzfOFh7eRgfxHmdHEWk8ddM9YmyAdjuBcfIc3PzuasJzQGzfn3d oLdrhwiBSy/IQutIFPSZ3ZvCIA3n6iHsIhxLQNBGxfnXphjjI2XhT2rQdiZbmaTM2msn MSxQ== 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=vSAhZlU3cc1f6R2gciMFVwjz3Y0xmsU0eN+/yBhrwpg=; b=mTKXEModiCIjJe8GVYl4SfIwpKJUgYOXbRCdK+THVTfUre4tnn2/glGkwFi6l24vhF 9IReT0Z8ALZad8af4hQdwFUYr7czwRtndic5itOw7h/p3wBgJ6uYMYjmumQvGXQBNXPA EkF6ZS20/OnNDyxbOU1cUfqtfxLsB9YaDSoE+nBZ9ZZGFR3KBoHF+UgjHnwto8cpIaIv 9ftlo5iYBoTFm3x4NLzpPK3qKgffyHAwh6Gp29Z1QXuI94TTcv8yU7JE2W57/mwiFLId Py+5ln/BTEqAa/OOPlHV+fruSzKApD4viyt7L+z4SqNcMrLtEOKI7qqOoP8zsSSRP2Qr x72g== X-Gm-Message-State: AOAM533JRK68kbfhTv4gNvofO65/+lBD9hR8ptD+0bVSXvE6wNlWT4pC zCIt1kvrAwAlltAjnRJDMloqfQ== X-Received: by 2002:a17:90a:c712:: with SMTP id o18mr2679294pjt.157.1621484255903; Wed, 19 May 2021 21:17:35 -0700 (PDT) Received: from x1 ([2601:1c0:4701:ae70:1ac3:31d1:689c:7daa]) by smtp.gmail.com with ESMTPSA id 128sm707095pfy.194.2021.05.19.21.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 21:17:35 -0700 (PDT) Date: Wed, 19 May 2021 21:17:33 -0700 From: Drew Fustini To: Andy Shevchenko Cc: Dario Binacchi , Linux Kernel Mailing List , Linus Walleij , "open list:GPIO SUBSYSTEM" , Vladimir Zapolskiy Subject: Re: [PATCH 1/2] pinctrl: core: configure pinmux from pins debug file Message-ID: <20210520041733.GA3269241@x1> References: <20210516135531.2203-1-dariobin@libero.it> <20210516135531.2203-2-dariobin@libero.it> <1735504854.166374.1621346262270@mail1.libero.it> <20210519100235.GA3063522@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 Wed, May 19, 2021 at 02:27:38PM +0300, Andy Shevchenko wrote: > On Wed, May 19, 2021 at 1:02 PM Drew Fustini wrote: > > On Tue, May 18, 2021 at 05:01:30PM +0300, Andy Shevchenko wrote: > > ... > > > Vladimir Zapolskiy wrote in e73339037f6b ("pinctrl: remove unused > > 'pinconf-config' debugfs interface"): > > > > Of course it might be possible to increase MAX_NAME_LEN, and then add > > .pin_config_dbg_parse_modify callbacks to the drivers, but the whole > > idea of such a limited debug option looks inviable. A more flexible > > way to functionally substitute the original approach is to implicitly > > or explicitly use pinctrl_select_state() function whenever needed. > > > > This makes me think it is not a good idea to bring back pinconf-config. > > The pinmux-select debugfs file that I add added in commit 6199f6becc86 > > ("pinctrl: pinmux: Add pinmux-select debugfs file") provides a method to > > activate a pin function and pin group which I think provides the same > > capability as long as the possible pin functions are described in dts. > > The problem is that the pinctrl_select_state() is very limited and has > no clear meanings of the states. Only few are defined and still > unclear. What does `sleep` or `standby` or whatever mean? It may be > quite different to the device in question. Basically what we need is > to say we want this device ('function') to appear on this group of > pins ('group'). And pinctrl_select_state() can't fulfill this simple > task :-( > > If we look at the ACPI case it makes that API completely out of useful > context (it can be used due to above and some kind of layering > violations, like PM vs. pin control). > > Since above is the debugfs interface we may return it for the certain > task, i.e. printing current function / group choice(s) (if it's not > done by other means) and allow to switch it desired function/group > (that's what Dario tries to achieve AFAIU). A write to the pinmux-select debugfs file will call pinmux_select() in drivers/pinctrl/pinmux.c which, after some validation checks, will call pmxops->set_mux() with function selector and group selector as arguments. For pinctrl-single, this will invoke pcs_set_mux() which will ultimately set the mux mode bits in the register for each pin in that function. IS that useful for pin controllers in ACPI systems as well? thanks, drew