Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
From: Drew Fustini <drew@beagleboard.org>
To: Tony Lindgren <tony@atomide.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	bcousson@baylibre.com, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jason Kridner <jkridner@beagleboard.org>,
	Robert Nelson <robertcnelson@gmail.com>,
	"H . Nikolaus Schaller" <hns@goldelico.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v2] ARM: dts: am335x-pocketbeagle: set default mux for gpio pins
Date: Tue, 30 Jun 2020 23:31:55 +0200
Message-ID: <20200630213155.GA115731@x1> (raw)
In-Reply-To: <20200630182037.GF37466@atomide.com>

On Tue, Jun 30, 2020 at 11:20:37AM -0700, Tony Lindgren wrote:
> * Drew Fustini <drew@beagleboard.org> [200630 02:02]:
> > On Mon, Jun 29, 2020 at 10:03:58AM -0700, Tony Lindgren wrote:
> > > Hi,
> > > 
> > > * Drew Fustini <drew@beagleboard.org> [200628 08:26]:
> > > > v2 changes:
> > > > - change default mux from output to input.  Input is safer as it does
> > > >   not drive the line.  If the user wants output, they will need to edit
> > > >   this device tree.
> > > 
> > > So can you please clarify this a bit, are you saying that gpio output can't
> > > be done via userspace?
> > 
> > As it stands, there is no way for userspace to change a pin from gpio 
> > input to gpio output as it is based on the reciever active bit in the
> > pin control register (table 9-60 in the AM3358 datasheet [0]).
> 
> OK. I guess one not so nice option would be to enable receiver active
> for all the gpio pins.. But this also affects power consumption a little.
> 
> > I thought it would be useful to at least define the GPIOs available for
> > use on the PocketBeagle by default (and eventually the other BeagleBone
> > device trees).  Input seems to be the safest value.  This patch at least
> > makes it more clear where the user should edit to switch from input to
> > output.
> 
> Some TI TRMs actually have tables listing the preferred mux logic
> for unused pins. I recall safe mode input pull down being one of the
> preferred modes. Sorry not sure which TRM that is, maybe omap3 or
> omap4 or omap5?

Yes, the AM3358 will default to mode 7 for all of these pins and the
receiver will be enabled (e.g. input).

So maybe it is redundant for me to specify in DT what is already the
hardware reset default?

I thought it might be helpful to at least show where the user should
edit to change it from the default reset behavior.

> > > Needing to change the dts does not sound good to me.. But maybe you mean
> > > this is needed until the gpio-omap and pinctrl-single patches are merged?
> >
> > I agree that I would like for userspace to be able to do run-time
> > changes.  However, I think something would need to be added to the
> > pinconf support in pinctrl-single for that to be possible.  There are
> > bias properties but non for receiver enable.
> > 
> > Does it seem sensible to add that?
> 
> Well let's see with Linus W says. To me it seems this might be a good
> reason to allow a sysfs interface to change the pinctrl if we don't
> have it yet? With the proper gpio line naming it should be quite simple
> to use too :)

I think if pinctrl-single allowed mux to be set through debugfs that
could be one solution to the use case of users prototyping with a
beaglebone.  Maybe that could be acceptable?

Thanks,
Drew

> 
> Regards,
> 
> Tony

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28 15:24 Drew Fustini
2020-06-29 17:03 ` Tony Lindgren
2020-06-30  2:01   ` Drew Fustini
2020-06-30 18:20     ` Tony Lindgren
2020-06-30 21:31       ` Drew Fustini [this message]
2020-06-30 21:34         ` Tony Lindgren
2020-06-30 21:42           ` Drew Fustini
2020-07-01 14:48             ` 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=20200630213155.GA115731@x1 \
    --to=drew@beagleboard.org \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hns@goldelico.com \
    --cc=jkridner@beagleboard.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robertcnelson@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.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

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git