mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dario Binacchi <dariobin@libero.it>
To: Drew Fustini <drew@beagleboard.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 1/2] pinctrl: core: configure pinmux from pins debug file
Date: Tue, 18 May 2021 11:38:38 +0200 (CEST)	[thread overview]
Message-ID: <960608833.161310.1621330718253@mail1.libero.it> (raw)
In-Reply-To: <20210517225713.GB2936462@x1>

Hi,

> Il 18/05/2021 00:57 Drew Fustini <drew@beagleboard.org> ha scritto:
> 
>  
> On Mon, May 17, 2021 at 11:02:00PM +0300, Andy Shevchenko wrote:
> > On Sun, May 16, 2021 at 7:43 PM Dario Binacchi <dariobin@libero.it> wrote:
> > >
> > > The MPUs of some architectures (e.g AM335x) must be in privileged
> > > operating mode to write on the pinmux
> > 
> > pinmux is not pin configuration. You need to rethink the approach.
> > 
> > > registers. In such cases, where
> > > writes will not work from user space, now it can be done from the pins
> > > debug file if the platform driver exports the pin_dbg_set() helper among
> > > the registered operations.
> > 
> > Drew, is it similar to what you are trying to achieve?
> 
> Yes, I would say this similar to what I was trying to accomplish: being
> able to change contents of conf_<module>_<pin> register [table 9-60]
> from userspace.
> 
> However, I was specifically looking to change bits 2:0 which is mux
> mode. My motivation was to allow BeagleBone users to easily switch
> between pin functions on the expansion headers during runtime to make
> rapid prototyping with a breadboard easier (such as changing header pin
> from GPIO to SPI mode). Most of the header pins have 7 different modes.
> 
> Ultimately, the solution I settled on with feedback from this list was
> to create pinmux-select debugfs file that can activate desired fucntion:
> 6199f6becc86 ("pinctrl: pinmux: Add pinmux-select debugfs file")
> 
> Bits 6:3 are related to what this subsystem would refer to as pin conf
> such as slew, input enable and bias. Thus it might make sense to expose
> something like a select-pinconf file to activate pin conf settings from
> userspace. This would require using 'pinconf-single' compatible.
> 
> I fixed pinctrl-single bug regarding pinconf last year so it should be
> possible to use 'pinconf-single' compatible for the am33xx_pinmux node:
> f46fe79ff1b6 ("pinctrl-single: fix pcs_parse_pinconf() return value")
> 

In the kernel version 4.1.6 that I am using on my custom board, I have fixed
the commit f07512e615dd ("pinctrl/pinconfig: add debug interface"). However, 
this feature was later removed (https://lore.kernel.org/patchwork/patch/1033755/). 
Do you think it is better to bring that functionality back to life or the submitted
patch could be fine too?

Thanks and regards,
Dario

> Thanks,
> Drew

  reply	other threads:[~2021-05-18  9:38 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 " 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 [this message]
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
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=960608833.161310.1621330718253@mail1.libero.it \
    --to=dariobin@libero.it \
    --cc=andy.shevchenko@gmail.com \
    --cc=drew@beagleboard.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®