public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alek Du <alek.du@intel.com>
To: Florian Fainelli <florian@openwrt.org>
Cc: Ben Dooks <ben-linux@fluff.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpiolib: Add gpio_detect, gpio_debounce and gpio_alt_func features to GPIOLIB
Date: Tue, 16 Jun 2009 09:21:21 +0800	[thread overview]
Message-ID: <20090616092121.3ed42b63@dxy.sh.intel.com> (raw)
In-Reply-To: <200906151504.51934.florian@openwrt.org>

On Mon, 15 Jun 2009 21:04:50 +0800
Florian Fainelli <florian@openwrt.org> wrote:

> Le Monday 15 June 2009 14:51:46 Ben Dooks, vous avez écrit :
> > On Mon, Jun 15, 2009 at 05:15:02PM +0800, Alek Du wrote:
> > > >From 7a76916ccea4a376a260ea67fbc79ac4d958757f Mon Sep 17 00:00:00 2001
> > >
> > > From: Alek Du <alek.du@intel.com>
> > > Date: Fri, 8 May 2009 09:46:49 +0800
> > > Subject: [PATCH] gpiolib: Add gpio_detect, gpio_debounce and
> > > gpio_alt_func features to GPIOLIB
> > >
> > > Add some more functions to GPIOLIB, they are:
> > > * gpio_detect is to set GPIO interrupt triggering method (edge, level,
> > > high, low, etc.)
> 
> The name does not seem to reflect what it does, what about gpio_set_type or 
> gpio_set_int_type for instance ?
> 
> >
> > This is the wrong way of doing it, there is as a definit set_type
> > method in the irq_chip structure which should be used to alter the
> > way the IRQ is triggered.
> 
> I would expect your architecture IRQ handler to have a set_type callback for 
> the GPIO lines capables of generating an interrupt. See how we have beeing 
> doing it for rb532 for instance: 
> http://www.linux-mips.org/git?p=linux-queue.git;a=blob;f=arch/mips/rb532/irq.c;h=f07882029a90d3d155c17b462812c2936229458c;hb=HEAD#l173


For you case, in set_type handler it calls a "rb532_gpio_set_ilevel", my purpose of the gpio_detect is to provide the general way to replace 
the private function like "rb532_gpio_set_ilevel". Suppose you have several type GPIO devices in the system, in you way, you have to export
different private function to set each GPIO device triggering mode. Also for some system, we have i2c or SPI GPIO expander, we need to hook
them on the fly. The gpio_detect API provide a general way to set triggering mode, you could call it under set_type callback.

Thanks,
Alek

  parent reply	other threads:[~2009-06-16  1:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15  9:15 [PATCH] gpiolib: Add gpio_detect, gpio_debounce and gpio_alt_func features to GPIOLIB Alek Du
2009-06-15  9:50 ` Ben Dooks
2009-06-15 10:02   ` Mark Brown
2009-06-15 11:19     ` Alek Du
2009-06-15 12:56       ` Florian Fainelli
2009-06-15 12:50     ` Ben Dooks
2009-06-15 13:07       ` Mark Brown
2009-06-15 11:29   ` Alek Du
2009-06-15 12:51 ` Ben Dooks
2009-06-15 13:04   ` Florian Fainelli
2009-06-15 13:09     ` Ben Dooks
2009-06-16  1:28       ` Alek Du
2009-06-16  8:39         ` Ben Dooks
2009-06-17  6:59           ` [PATCH v2] gpiolib: Add " Alek Du
2009-06-17  9:36             ` Ben Nizette
2009-06-16  1:21     ` Alek Du [this message]
2009-06-16  8:45       ` [PATCH] gpiolib: Add gpio_detect, " Ben Dooks
2009-06-16  8:51         ` Alek Du
2009-06-16  9:02           ` Ben Dooks

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=20090616092121.3ed42b63@dxy.sh.intel.com \
    --to=alek.du@intel.com \
    --cc=ben-linux@fluff.org \
    --cc=florian@openwrt.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