devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Johan Hovold <johan@kernel.org>,
	Martin Fuzzey <mfuzzey@parkeon.com>,
	devicetree@vger.kernel.org, Alexandre Courbot <gnurou@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH  0/2] gpio: Allow userspace export from DT
Date: Wed, 6 May 2015 14:43:54 +0200	[thread overview]
Message-ID: <20150506124354.GA5302@localhost> (raw)
In-Reply-To: <20150506112449.GQ2067@n2100.arm.linux.org.uk>

On Wed, May 06, 2015 at 12:24:50PM +0100, Russell King - ARM Linux wrote:
> On Mon, May 04, 2015 at 10:49:25AM +0200, Johan Hovold wrote:
> > Firmware should describe pin directionality and function, and undefined
> > pins should never be allowed to be accessed from userspace.
> 
> No, that's totally wrong if you consider one of the most common use
> cases out there...
> 
> Think about something like a Raspberry Pi, where you have a header with
> GPIOs on it, which can be used for multiple different purposes (and are
> even multiplexed with some on-SoC functions.)
> 
> "Firmware" can't know about all possible configurations of those IO pins.
> 
> That's why Raspberry Pi uses a userspace helper and programs stuff up
> appropriately for the users application.

I'm not familiar with exactly how the RPi handles its pin muxing, but
even if it requires userspace interaction that should not prevent having
firmware describe the pins.

In general, if the hardware configuration is static we use device trees.

If the configuration is dynamic we use device-tree overlays; either
loaded manually or by some service (e.g. Beaglebone capes). Perhaps this
could be handled by the RPi helper.

And for experimentation / development, firmware could even be totally
non-restrictive by simply declaring generic pin "functions" like
"expansion-pin-4" and even allow for the direction to be changed.

Johan

  reply	other threads:[~2015-05-06 12:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 11:05 [PATCH 0/2] gpio: Allow userspace export from DT Martin Fuzzey
2015-04-13 11:05 ` [PATCH 1/2] Doc: DT: Add binding document for GPIO exporter Martin Fuzzey
2015-04-13 11:05 ` [PATCH 2/2] gpio: add driver to export DT configured GPIOs to userspace Martin Fuzzey
2015-04-15 13:19 ` [PATCH 0/2] gpio: Allow userspace export from DT Rob Herring
     [not found]   ` <CAL_JsqJorndYh4ROdKbJfpG1KY=Xosjc6BMFYRPrb+BsauFsnQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-28 12:56     ` Linus Walleij
2015-05-04  8:49 ` Johan Hovold
2015-05-06  7:22   ` Linus Walleij
2015-05-06 13:06     ` Johan Hovold
2015-05-06 17:56       ` Fuzzey, Martin
2015-05-08  9:31         ` Johan Hovold
2015-05-06 13:19     ` Rob Herring
2015-05-06 11:24   ` Russell King - ARM Linux
2015-05-06 12:43     ` Johan Hovold [this message]
2015-05-06 12:57       ` Russell King - ARM Linux
     [not found]         ` <20150506125707.GV2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-05-06 13:25           ` Johan Hovold
2015-05-07  5:38             ` Jiří Prchal
2015-05-07 12:28             ` Russell King - ARM Linux
     [not found]               ` <20150507122840.GB2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-05-08 10:04                 ` Johan Hovold

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=20150506124354.GA5302@localhost \
    --to=johan@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mfuzzey@parkeon.com \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).