aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/gpio.h
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-10-16 01:03:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:40 -0400
commit35e8bb5175c1a6ff6253f1a2acb30bfe52a2f500 (patch)
tree88a1e9695824f88efef3340fd53f8dbe576f5852 /include/asm-generic/gpio.h
parent93a22f8b95756c53e80308820892119c910d2739 (diff)
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 04cb1d175df..81797ec9ab2 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -35,6 +35,10 @@ struct module;
35 * @label: for diagnostics 35 * @label: for diagnostics
36 * @dev: optional device providing the GPIOs 36 * @dev: optional device providing the GPIOs
37 * @owner: helps prevent removal of modules exporting active GPIOs 37 * @owner: helps prevent removal of modules exporting active GPIOs
38 * @request: optional hook for chip-specific activation, such as
39 * enabling module power and clock; may sleep
40 * @free: optional hook for chip-specific deactivation, such as
41 * disabling module power and clock; may sleep
38 * @direction_input: configures signal "offset" as input, or returns error 42 * @direction_input: configures signal "offset" as input, or returns error
39 * @get: returns value for signal "offset"; for output signals this 43 * @get: returns value for signal "offset"; for output signals this
40 * returns either the value actually sensed, or zero 44 * returns either the value actually sensed, or zero
@@ -67,6 +71,11 @@ struct gpio_chip {
67 struct device *dev; 71 struct device *dev;
68 struct module *owner; 72 struct module *owner;
69 73
74 int (*request)(struct gpio_chip *chip,
75 unsigned offset);
76 void (*free)(struct gpio_chip *chip,
77 unsigned offset);
78
70 int (*direction_input)(struct gpio_chip *chip, 79 int (*direction_input)(struct gpio_chip *chip,
71 unsigned offset); 80 unsigned offset);
72 int (*get)(struct gpio_chip *chip, 81 int (*get)(struct gpio_chip *chip,