linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Valerio Riedel <hvr@gnu.org>
To: pHilipp Zabel <philipp.zabel@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, Paul Sokolovsky <pmiscml@gmail.com>,
	Philip Blundell <philb@gnu.org>
Subject: Re: [PATCH,RFC] Input: gpio-keys - request and configure GPIOs
Date: Fri, 16 Nov 2007 15:15:45 +0100	[thread overview]
Message-ID: <1195222545.10848.54.camel@pbook.intra> (raw)
In-Reply-To: <74d0deb30711160602k3e19a660td5698b395f817a85@mail.gmail.com>


On Fri, 2007-11-16 at 15:02 +0100, pHilipp Zabel wrote:
> On Nov 16, 2007 2:38 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > On Nov 16, 2007 6:33 AM, Herbert Valerio Riedel <hvr@gnu.org> wrote:
> > > Currently, gpio_keys.c assumes the GPIOs to be already properly configured;
> > > this patch changes gpio-keys to perform explicit calls to gpio_request() and
> > > gpio_configure_input().
> > >
> > > This matches the behaviour of leds-gpio.

> > Makes sense from where I sit but let's see what guys who actually use
> > the module say... ;)

> Looks good to me, too. I have yet to test, but at least the gpio_direction call
> is mandatory as per gpio api docs, so this fixes an actual bug.

> gpio_request is optional and claims the GPIO for this driver's use
> only (on architectures where this is supported), so I'm not sure if this is really needed, but it
> shouldn't harm any of the current users of gpio-keys.

yes, optional and no-harm, to quote the gpio API doc:

> These two calls are optional because not not all current Linux platforms
> offer such functionality in their GPIO support; a valid implementation
> could return success for all gpio_request() calls.  Unlike the other calls,
> the state they represent doesn't normally match anything from a hardware
> register; it's just a software bitmap which clearly is not necessary for
> correct operation of hardware or (bug free) drivers.

...but for instance, the current mach-orion/gpio.c implementation,
prints annoying printk warnings when someone fiddles with "unrequested"
GPIOs... :-)

cheers,
hvr


  reply	other threads:[~2007-11-16 14:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-16 11:33 [PATCH,RFC] Input: gpio-keys - request and configure GPIOs Herbert Valerio Riedel
2007-11-16 11:50 ` Herbert Valerio Riedel
2007-11-16 13:38 ` Dmitry Torokhov
2007-11-16 14:02   ` pHilipp Zabel
2007-11-16 14:15     ` Herbert Valerio Riedel [this message]
2007-11-16 14:09   ` Herbert Valerio Riedel
2007-11-16 14:19     ` pHilipp Zabel
2007-11-21 17:13       ` Herbert Valerio Riedel
2007-11-21 19:44         ` Dmitry Torokhov

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=1195222545.10848.54.camel@pbook.intra \
    --to=hvr@gnu.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=philb@gnu.org \
    --cc=philipp.zabel@gmail.com \
    --cc=pmiscml@gmail.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).