diff options
author | David Brownell <david-b@pacbell.net> | 2007-02-16 04:27:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-16 11:13:55 -0500 |
commit | f5de611148c8370cbe50796ca5567ca624b99686 (patch) | |
tree | b3dd73c3ad0414bbc83bca31f800a7af1b79dc3a /Documentation/gpio.txt | |
parent | 7de970e11fb832a56c897276967fb0e49f59b313 (diff) |
[PATCH] GPIO core documentation
Small updates to the GPIO documentation, addressing feedback and
fixing a few spelling errors.
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 | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 09dd510c4a5f..576ce463cf44 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -78,7 +78,8 @@ Identifying GPIOs | |||
78 | ----------------- | 78 | ----------------- |
79 | GPIOs are identified by unsigned integers in the range 0..MAX_INT. That | 79 | GPIOs are identified by unsigned integers in the range 0..MAX_INT. That |
80 | reserves "negative" numbers for other purposes like marking signals as | 80 | reserves "negative" numbers for other purposes like marking signals as |
81 | "not available on this board", or indicating faults. | 81 | "not available on this board", or indicating faults. Code that doesn't |
82 | touch the underlying hardware treats these integers as opaque cookies. | ||
82 | 83 | ||
83 | Platforms define how they use those integers, and usually #define symbols | 84 | Platforms define how they use those integers, and usually #define symbols |
84 | for the GPIO lines so that board-specific setup code directly corresponds | 85 | for the GPIO lines so that board-specific setup code directly corresponds |
@@ -139,10 +140,10 @@ issues including wire-OR and output latencies. | |||
139 | The get/set calls have no error returns because "invalid GPIO" should have | 140 | The get/set calls have no error returns because "invalid GPIO" should have |
140 | been reported earlier in gpio_set_direction(). However, note that not all | 141 | been reported earlier in gpio_set_direction(). However, note that not all |
141 | platforms can read the value of output pins; those that can't should always | 142 | platforms can read the value of output pins; those that can't should always |
142 | return zero. Also, these calls will be ignored for GPIOs that can't safely | 143 | return zero. Also, using these calls for GPIOs that can't safely be accessed |
143 | be accessed wihtout sleeping (see below). | 144 | without sleeping (see below) is an error. |
144 | 145 | ||
145 | Platform-specific implementations are encouraged to optimise the two | 146 | Platform-specific implementations are encouraged to optimize the two |
146 | calls to access the GPIO value in cases where the GPIO number (and for | 147 | calls to access the GPIO value in cases where the GPIO number (and for |
147 | output, value) are constant. It's normal for them to need only a couple | 148 | output, value) are constant. It's normal for them to need only a couple |
148 | of instructions in such cases (reading or writing a hardware register), | 149 | of instructions in such cases (reading or writing a hardware register), |
@@ -239,7 +240,8 @@ options are part of the IRQ interface, e.g. IRQF_TRIGGER_FALLING, as are | |||
239 | system wakeup capabilities. | 240 | system wakeup capabilities. |
240 | 241 | ||
241 | Non-error values returned from irq_to_gpio() would most commonly be used | 242 | Non-error values returned from irq_to_gpio() would most commonly be used |
242 | with gpio_get_value(). | 243 | with gpio_get_value(), for example to initialize or update driver state |
244 | when the IRQ is edge-triggered. | ||
243 | 245 | ||
244 | 246 | ||
245 | 247 | ||
@@ -260,9 +262,10 @@ pullups (or pulldowns) so that the on-chip ones should not be used. | |||
260 | There are other system-specific mechanisms that are not specified here, | 262 | There are other system-specific mechanisms that are not specified here, |
261 | like the aforementioned options for input de-glitching and wire-OR output. | 263 | like the aforementioned options for input de-glitching and wire-OR output. |
262 | Hardware may support reading or writing GPIOs in gangs, but that's usually | 264 | Hardware may support reading or writing GPIOs in gangs, but that's usually |
263 | configuration dependednt: for GPIOs sharing the same bank. (GPIOs are | 265 | configuration dependent: for GPIOs sharing the same bank. (GPIOs are |
264 | commonly grouped in banks of 16 or 32, with a given SOC having several such | 266 | commonly grouped in banks of 16 or 32, with a given SOC having several such |
265 | banks.) Code relying on such mechanisms will necessarily be nonportable. | 267 | banks.) Some systems can trigger IRQs from output GPIOs. Code relying on |
268 | such mechanisms will necessarily be nonportable. | ||
266 | 269 | ||
267 | Dynamic definition of GPIOs is not currently supported; for example, as | 270 | Dynamic definition of GPIOs is not currently supported; for example, as |
268 | a side effect of configuring an add-on board with some GPIO expanders. | 271 | a side effect of configuring an add-on board with some GPIO expanders. |