public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <grant.likely@secretlab.ca>, <jamie@jamieiles.com>,
	<cbouatmailru@gmail.com>, <akpm@linux-foundation.org>,
	<rmk+kernel@arm.linux.org.uk>
Subject: basic_mmio_gpio: Add hook for simple debounce register
Date: Wed, 16 Nov 2011 12:02:15 -0700	[thread overview]
Message-ID: <201111161202.15485.hartleys@visionengravers.com> (raw)

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;

             reply	other threads:[~2011-11-16 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 19:02 H Hartley Sweeten [this message]
2011-11-16 21:40 ` basic_mmio_gpio: Add hook for simple debounce register Anton Vorontsov
2011-11-16 22:41   ` H Hartley Sweeten

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=201111161202.15485.hartleys@visionengravers.com \
    --to=hartleys@visionengravers.com \
    --cc=akpm@linux-foundation.org \
    --cc=cbouatmailru@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=jamie@jamieiles.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    /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