public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* basic_mmio_gpio: Add hook for simple debounce register
@ 2011-11-16 19:02 H Hartley Sweeten
  2011-11-16 21:40 ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: H Hartley Sweeten @ 2011-11-16 19:02 UTC (permalink / raw)
  To: Linux Kernel; +Cc: grant.likely, jamie, cbouatmailru, akpm, rmk+kernel

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-16 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 19:02 basic_mmio_gpio: Add hook for simple debounce register H Hartley Sweeten
2011-11-16 21:40 ` Anton Vorontsov
2011-11-16 22:41   ` H Hartley Sweeten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox