diff options
author | Felipe Balbi <felipe.balbi@nokia.com> | 2010-05-26 17:42:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:42 -0400 |
commit | c4b5be98fe78508e7199d6919eb712feba9a4f01 (patch) | |
tree | 9e688dd076cea9213f8bcbda3627aa7941a01879 /include/linux/gpio.h | |
parent | 796a8e423ac8afe9e98ad96e668f50142bdd7825 (diff) |
gpiolib: introduce set_debounce method
A few architectures, like OMAP, allow you to set a debouncing time for the
gpio before generating the IRQ. Teach gpiolib about that.
Mark said:
: This would be generally useful for embedded systems, especially where
: the interrupt concerned is a wake source. It allows drivers to avoid
: spurious interrupts from noisy sources so if the hardware supports it
: the driver can avoid having to explicitly wait for the signal to become
: stable and software has to cope with fewer events. We've lived without
: it for quite some time, though.
David said:
: I looked at adding debounce support to the generic GPIO calls (and thus
: gpiolib) some time back, but decided against it. I forget why at this
: time (check list archives) but it wasn't because of lack of utility in
: certain contexts.
:
: One thing to watch out for is just how variable the hardware capabilities
: are. Atmel GPIOs have something like a fixed number of 32K clock cycles
: for debounce, twl4030 had something odd, OMAPs were more like the Atmel
: chips but with a different clock. In some cases debouncing had to be
: ganged, not per-GPIO. And so forth.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <david-b@pacbell.net>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r-- | include/linux/gpio.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 4e949a5b5b85..03f616b78cfa 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -51,6 +51,11 @@ static inline int gpio_direction_output(unsigned gpio, int value) | |||
51 | return -ENOSYS; | 51 | return -ENOSYS; |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) | ||
55 | { | ||
56 | return -ENOSYS; | ||
57 | } | ||
58 | |||
54 | static inline int gpio_get_value(unsigned gpio) | 59 | static inline int gpio_get_value(unsigned gpio) |
55 | { | 60 | { |
56 | /* GPIO can never have been requested or set as {in,out}put */ | 61 | /* GPIO can never have been requested or set as {in,out}put */ |