aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/gpio.txt
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>2008-04-28 05:14:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:34 -0400
commite6de1808f8ebfeb7e49f3c5a30cb8f2032beb287 (patch)
tree2230ea8f384449c7785d636ab016af3b2aa20123 /Documentation/gpio.txt
parentd72cbed0c486e3db8b56380635f8e845073ce63a (diff)
gpio: define gpio_is_valid()
Introduce a gpio_is_valid() predicate; use it in gpiolib. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> [ use inline function; follow the gpio_* naming convention; work without gpiolib; all programming interfaces need docs ] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/gpio.txt')
-rw-r--r--Documentation/gpio.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index 54630095aa3c..c35ca9e40d4c 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -107,6 +107,16 @@ type of GPIO controller, and on one particular board 80-95 with an FPGA.
107The numbers need not be contiguous; either of those platforms could also 107The numbers need not be contiguous; either of those platforms could also
108use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders. 108use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders.
109 109
110If you want to initialize a structure with an invalid GPIO number, use
111some negative number (perhaps "-EINVAL"); that will never be valid. To
112test if a number could reference a GPIO, you may use this predicate:
113
114 int gpio_is_valid(int number);
115
116A number that's not valid will be rejected by calls which may request
117or free GPIOs (see below). Other numbers may also be rejected; for
118example, a number might be valid but unused on a given board.
119
110Whether a platform supports multiple GPIO controllers is currently a 120Whether a platform supports multiple GPIO controllers is currently a
111platform-specific implementation issue. 121platform-specific implementation issue.
112 122