lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectbasic_mmio_gpio: Add hook for simple debounce register
Date
Some platforms using the basic memory-mapped GPIO library have
simple input debounce support that is enabled/disabled, per-input,
by setting/clearing bits in a control register. Add a hook in the
bgpio_chip structure to hold the void __iomem * for this register.

This register, and the gc.set_debounce callback should set by the
platform after calling bgpio_init() and before calling gpiochip_add().

...
err = bgpio_chip(bgc, ...);
if (err)
return err;

bgc->reg_db = platform_debounce_reg;
bgc->gc.set_debounce = platform_set_debounce_func;

return gpiochip_add(&bgc->gc);
}

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
CC: Russell King <rmk+kernel@arm.linux.org.uk>

---

diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
index feb91219..9bec937 100644
--- a/include/linux/basic_mmio_gpio.h
+++ b/include/linux/basic_mmio_gpio.h
@@ -35,6 +35,7 @@ struct bgpio_chip {
void __iomem *reg_set;
void __iomem *reg_clr;
void __iomem *reg_dir;
+ void __iomem *reg_db;

/* Number of bits (GPIOs): <register width> * 8. */
int bits;

\
 
 \ /
  Last update: 2011-11-16 20:05    [W:0.061 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site