mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: "Francis Moreau" <francis.moro@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: question on generic gpio interface
Date: Tue, 17 Apr 2007 09:42:49 -0700	[thread overview]
Message-ID: <200704170942.49626.david-b@pacbell.net> (raw)
In-Reply-To: <38b2ab8a0704170004h12c4ea41we6bdab3a1b443a18@mail.gmail.com>

On Tuesday 17 April 2007 12:04 am, Francis Moreau wrote:

> BTW, are there any plan to make gpio usable from userspace ? I don't
> know if it makes sense but I saw some patches on LKML that did that.

Only the usual plan:  someone who wants that feature provides a driver,
which can be merged after suitable review.

For example, the gpio_keys and leds-gpio drivers already exist to
expose some kinds of GPIOs ... though not specifically as GPIOs.
And I've seen various drivers that package GPIOs on specific chips,
mostly for _exclusive_ use by userspace (no kernel access).


In this case I'm not entirely sure how it'd work.  I've seen a few
drivers which let userspace peek and poke at GPIO signals -- like
one for Gumstix boards -- but generalizing the model isn't simple.
Sub-problems include:

 - Configuring the relevant pins.  Especially for SOC cases, GPIO
   roles are multiplexed with several others.  So there are two
   issues:  (a) the platform-specific setup of that multiplexing,
   plus (b) the board-specific knowledge of what pins are truly
   available for use as GPIOs, and not otherwise in use.

 - Enumerating those GPIOs to userspace.  One SOC might have just
   a few dozen, another might have a few hundred; and then there
   are all the board-specific ones, on FPGA or I2C chips etc.

 - Exposing those pins to userspace.  It'd be unsafe to let pins
   claimed by drivers be managed by userspace; the default should
   be that only unclaimed GPIOs can be accessed.

Those points imply part of a design that includes board-specific
hooks of various kinds (maybe delegating a lot to platform code).

But nobody's yet provided code that would generalize.

- Dave

  reply	other threads:[~2007-04-17 18:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 20:51 Francis Moreau
2007-04-13 22:43 ` David Brownell
2007-04-16 10:03   ` Francis Moreau
2007-04-16 13:46     ` David Brownell
2007-04-17  7:04       ` Francis Moreau
2007-04-17 16:42         ` David Brownell [this message]
2007-04-19  8:05           ` Francis Moreau
2007-04-19 18:06             ` David Brownell

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=200704170942.49626.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=francis.moro@gmail.com \
    --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®