Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2157874pxj; Thu, 20 May 2021 01:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh1Q+U+i9cyvUibD1r3dUrozb+BXNs0GMXyvEh8G3W5XQckVkSmzwk7Ww1MuaRqYSuzvSm X-Received: by 2002:aa7:cb10:: with SMTP id s16mr3616821edt.313.1621498326061; Thu, 20 May 2021 01:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621498326; cv=none; d=google.com; s=arc-20160816; b=PWR22ZB5ZyMXaQ85lrgGT2JenNOv4CgT42EOVFOLFPkDd37FdlrfpvjjD17TYbQlxI l62Nged+VScCJm00hQ9VeYKrBid5LRKID8QpA7Nlfzwx2SZNwaBGpOlUApB0ZwwU0lWP 7XjKx4M59bbzWz4N3olH/9HCAKEYwRqfWyDUe48XgGxJkrUstVOy0SWBC6aZnzyEAspC boCkPSk6tDjrtvAUUZx5Acjeu3fMfJflg80NGe0mW5s+G/8hppN6v2AU4uicKQdW59bx OzPOLwGY9M9AtHpHnikoZ2KUdkRDhfReei/y/w2WZm6s3GpU8vcZm6rH3oDRVQ3vm89C Ym1w== 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=fgc3MSJEF2dvUk6J7VrW1TUKtv/b5izfCPz91BOaza0=; b=vjqiHI2R21xt3/1pfmCkoKVT6WLVyBL2kLTt+UAZVbjPFV8mRLi1RTLpXFnQdyi+qx LWLVw8gJ9kZV872rx77L8LIC0aY4R/DMbDyXuvboCxEaKIQmcb+U+6A1UuOWCW4aCV+H 86tGtE83+NglfCR+tT1Oz7xMNhqNXkzLET65DCSrqwktzDbssJhhomME2Vdy4luUjJJf DXBIAVYadLlfNMpS2Ee0Ji5kprbeGcn6MS7F99ESKe7aFWjVkhIsnhwH9fudQt0QhCp+ M7kgm3LO7ykc29PmkWWL85ps0yr0btCO/K2+k59N7WnT3JXWg68BAczDLccPOnL9Uib3 /8tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fWtJFnkB; 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 q17si2198930ejj.672.2021.05.20.01.11.42; Thu, 20 May 2021 01:12:06 -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=@gmail.com header.s=20161025 header.b=fWtJFnkB; 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 S231190AbhETILv (ORCPT + 99 others); Thu, 20 May 2021 04:11:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbhETILt (ORCPT ); Thu, 20 May 2021 04:11:49 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB19C061574; Thu, 20 May 2021 01:10:28 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id 10so11809240pfl.1; Thu, 20 May 2021 01:10:28 -0700 (PDT) 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=fgc3MSJEF2dvUk6J7VrW1TUKtv/b5izfCPz91BOaza0=; b=fWtJFnkBqwr4/yT89SomaJ3S6WBdDp0OG4kypY94b6UdCw6ipsBwPeD5DjLw1O1b7i BlKnNzo7HhhPX/XT6+yPfWx8TAvA4f1PSiMOewiV5L7gkVyK75mb8/03NaiJ/MnhPOeH 4oYfhT+cTHeot+gwslIG+A6YQXVzv1hbRmeRwDTp6k4aHpl+iaEpOtiql+fPQQ8MI4+z 300RmnrFlhXo52Cg0X09mwhgVZjgfei7TlphhegLuHil1Ri2hqtwegFiR+5NeJ4/6mhX pMzYc0YFSgCOWh+g+/d8CNKmWaowoCt+xuwtZGQiu8U4iUmczwctGn4Yc7x66fr0gvDW DT9w== 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=fgc3MSJEF2dvUk6J7VrW1TUKtv/b5izfCPz91BOaza0=; b=ewGo306VYeuphfYUpd4wpXzo2CcuYsVZCxAxSyBIe7SY1xTJqIubhA1dcSPLZsTz1g 3Ykf1ZXIjUNgoMl9NxrtHEei45cTOvKZ1w7fwtIZTU6kRHgvKKt3XOrELkMq5MG6xte4 ISKuQ4mJ/bSbFO1/ogVRmoi2FZxJJDqhDx+9JRsN54f+OsY0sbVZmsyyCg4Ff96RzVwX pAtk1m1Z2aaqcCF/WIJsKpFFBbGdUvGuTGALapUDAzAIpV5W/n6Kh9/q8ezdfKELnXG4 e8CqSQHGQPPRi2wbWcvcX+fu0SYGENrmSMaECsVJjjNoE8v3SR1NRkxfGaM26ufG8KcV YUOg== X-Gm-Message-State: AOAM5300DQTFGtaVDc57D42iTtNzAkn2TlzACoQ5DSMjEYmOb9229uDZ ZExkDs7quvpRd9FACQbUHEO/r4gouZh5MvAuhCxN/IWxLEg= X-Received: by 2002:a63:79c3:: with SMTP id u186mr3377788pgc.203.1621498227612; Thu, 20 May 2021 01:10:27 -0700 (PDT) MIME-Version: 1.0 References: <20210516135531.2203-1-dariobin@libero.it> <20210516135531.2203-2-dariobin@libero.it> <1735504854.166374.1621346262270@mail1.libero.it> <20210519100235.GA3063522@x1> <20210520041733.GA3269241@x1> In-Reply-To: <20210520041733.GA3269241@x1> From: Andy Shevchenko Date: Thu, 20 May 2021 11:10:11 +0300 Message-ID: Subject: Re: [PATCH 1/2] pinctrl: core: configure pinmux from pins debug file To: Drew Fustini Cc: Dario Binacchi , Linux Kernel Mailing List , Linus Walleij , "open list:GPIO SUBSYSTEM" , Vladimir Zapolskiy Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 7:17 AM Drew Fustini wrote: > 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? Yes, the debugfs interface is useful independently of the resource provider. What I was talking about is the boot / driver load time pin muxing and configuration as well as PM transitions. -- With Best Regards, Andy Shevchenko