linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Drew Fustini <drew@beagleboard.org>
Cc: Dario Binacchi <dariobin@libero.it>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Vladimir Zapolskiy <vz@mleia.com>
Subject: Re: [PATCH 1/2] pinctrl: core: configure pinmux from pins debug file
Date: Thu, 20 May 2021 11:10:11 +0300	[thread overview]
Message-ID: <CAHp75Venn3Z6qz2HsELW108QORzZoLYdY8mDTxaKX-8c_3p3hA@mail.gmail.com> (raw)
In-Reply-To: <20210520041733.GA3269241@x1>

On Thu, May 20, 2021 at 7:17 AM Drew Fustini <drew@beagleboard.org> 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 <drew@beagleboard.org> 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

  reply	other threads:[~2021-05-20  8:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-16 13:55 [PATCH 0/2] am335x: set pinmux registers from pins debug file Dario Binacchi
2021-05-16 13:55 ` [PATCH 1/2] pinctrl: core: configure pinmux " Dario Binacchi
2021-05-17 20:02   ` Andy Shevchenko
2021-05-17 22:57     ` Drew Fustini
2021-05-18  9:38       ` Dario Binacchi
2021-05-18 10:21         ` Drew Fustini
2021-05-18 10:41           ` Andy Shevchenko
2021-05-18 13:57     ` Dario Binacchi
2021-05-18 14:01       ` Andy Shevchenko
2021-05-19 10:02         ` Drew Fustini
2021-05-19 11:27           ` Andy Shevchenko
2021-05-20  4:17             ` Drew Fustini
2021-05-20  8:10               ` Andy Shevchenko [this message]
2021-05-16 13:55 ` [PATCH 2/2] pinctrl: single: set " Dario Binacchi
2021-05-17  5:57   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75Venn3Z6qz2HsELW108QORzZoLYdY8mDTxaKX-8c_3p3hA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=dariobin@libero.it \
    --cc=drew@beagleboard.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).