summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/gpio.h
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-10-15 22:03:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 11:21:40 -0700
commit35e8bb5175c1a6ff6253f1a2acb30bfe52a2f500 (patch)
tree88a1e9695824f88efef3340fd53f8dbe576f5852 /include/asm-generic/gpio.h
parent93a22f8b95756c53e80308820892119c910d2739 (diff)
downloadop-kernel-dev-35e8bb5175c1a6ff6253f1a2acb30bfe52a2f500.zip
op-kernel-dev-35e8bb5175c1a6ff6253f1a2acb30bfe52a2f500.tar.gz
gpiolib: request/free hooks
Add a new internal mechanism to gpiolib to support low power operations by letting gpio_chip instances see when their GPIOs are in use. When no GPIOs are active, chips may be able to enter lower powered runtime states by disabling clocks and/or power domains. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Magnus Damm" <magnus.damm@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/gpio.h')
-rw-r--r--include/asm-generic/gpio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 04cb1d1..81797ec 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -35,6 +35,10 @@ struct module;
* @label: for diagnostics
* @dev: optional device providing the GPIOs
* @owner: helps prevent removal of modules exporting active GPIOs
+ * @request: optional hook for chip-specific activation, such as
+ * enabling module power and clock; may sleep
+ * @free: optional hook for chip-specific deactivation, such as
+ * disabling module power and clock; may sleep
* @direction_input: configures signal "offset" as input, or returns error
* @get: returns value for signal "offset"; for output signals this
* returns either the value actually sensed, or zero
@@ -67,6 +71,11 @@ struct gpio_chip {
struct device *dev;
struct module *owner;
+ int (*request)(struct gpio_chip *chip,
+ unsigned offset);
+ void (*free)(struct gpio_chip *chip,
+ unsigned offset);
+
int (*direction_input)(struct gpio_chip *chip,
unsigned offset);
int (*get)(struct gpio_chip *chip,
OpenPOWER on IntegriCloud