diff options
author | David Brownell <david-b@pacbell.net> | 2007-05-17 01:11:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-17 08:23:05 -0400 |
commit | 83c6590cb83d3106df12fee36ac2a261951b8c88 (patch) | |
tree | 8906e0f3366959e2595d26d263ab32922958743b /Documentation/gpio.txt | |
parent | 621e59a771f310358ade8f14cb745d5d5f1c410e (diff) |
gpio interface loosens call restrictions
Loosen gpio_{request,free}() and gpio_direction_{in,out}put() call context
restrictions slightly, so a common idiom is no longer an error: board init
code setting up spinlock-safe GPIOs before tasking is enabled.
The issue was caught by some paranoid code with might_sleep() checks. The
legacy platform-specific GPIO interfaces stick to spinlock-safe GPIOs, so this
change reflects current implementations and won't break anything.
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 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index e8be0abb346c..36af58eba136 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -111,7 +111,9 @@ setting up a platform_device using the GPIO, is mark its direction: | |||
111 | 111 | ||
112 | The return value is zero for success, else a negative errno. It should | 112 | The return value is zero for success, else a negative errno. It should |
113 | be checked, since the get/set calls don't have error returns and since | 113 | be checked, since the get/set calls don't have error returns and since |
114 | misconfiguration is possible. (These calls could sleep.) | 114 | misconfiguration is possible. You should normally issue these calls from |
115 | a task context. However, for spinlock-safe GPIOs it's OK to use them | ||
116 | before tasking is enabled, as part of early board setup. | ||
115 | 117 | ||
116 | For output GPIOs, the value provided becomes the initial output value. | 118 | For output GPIOs, the value provided becomes the initial output value. |
117 | This helps avoid signal glitching during system startup. | 119 | This helps avoid signal glitching during system startup. |
@@ -197,7 +199,9 @@ However, many platforms don't currently support this mechanism. | |||
197 | 199 | ||
198 | Passing invalid GPIO numbers to gpio_request() will fail, as will requesting | 200 | Passing invalid GPIO numbers to gpio_request() will fail, as will requesting |
199 | GPIOs that have already been claimed with that call. The return value of | 201 | GPIOs that have already been claimed with that call. The return value of |
200 | gpio_request() must be checked. (These calls could sleep.) | 202 | gpio_request() must be checked. You should normally issue these calls from |
203 | a task context. However, for spinlock-safe GPIOs it's OK to request GPIOs | ||
204 | before tasking is enabled, as part of early board setup. | ||
201 | 205 | ||
202 | These calls serve two basic purposes. One is marking the signals which | 206 | These calls serve two basic purposes. One is marking the signals which |
203 | are actually in use as GPIOs, for better diagnostics; systems may have | 207 | are actually in use as GPIOs, for better diagnostics; systems may have |