diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-28 05:14:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:34 -0400 |
commit | e6de1808f8ebfeb7e49f3c5a30cb8f2032beb287 (patch) | |
tree | 2230ea8f384449c7785d636ab016af3b2aa20123 /Documentation/gpio.txt | |
parent | d72cbed0c486e3db8b56380635f8e845073ce63a (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.txt | 10 |
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. | |||
107 | The numbers need not be contiguous; either of those platforms could also | 107 | The numbers need not be contiguous; either of those platforms could also |
108 | use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders. | 108 | use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders. |
109 | 109 | ||
110 | If you want to initialize a structure with an invalid GPIO number, use | ||
111 | some negative number (perhaps "-EINVAL"); that will never be valid. To | ||
112 | test if a number could reference a GPIO, you may use this predicate: | ||
113 | |||
114 | int gpio_is_valid(int number); | ||
115 | |||
116 | A number that's not valid will be rejected by calls which may request | ||
117 | or free GPIOs (see below). Other numbers may also be rejected; for | ||
118 | example, a number might be valid but unused on a given board. | ||
119 | |||
110 | Whether a platform supports multiple GPIO controllers is currently a | 120 | Whether a platform supports multiple GPIO controllers is currently a |
111 | platform-specific implementation issue. | 121 | platform-specific implementation issue. |
112 | 122 | ||