diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-03-05 19:22:14 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-03-12 13:27:07 -0400 |
commit | 0dc665d426691fd75fe9b6b16295ad0c02677d21 (patch) | |
tree | e45f9a48aeab4d1dd3ad20ef175a9d4cedda4ba2 /Documentation/gpio.txt | |
parent | 46158aad96b0a90b52fd345f89951a50b3d1a81f (diff) |
Documentation/gpio.txt: Explain expected pinctrl interaction
Update gpio.txt based on recent discussions regarding interaction with the
pinctrl subsystem.
Previously, gpio_request() was described as explicitly not performing any
required mux setup operations etc.
Now, gpio_request() is explicitly as explicitly performing any required mux
setup operations where possible. In the case it isn't, platform code is
required to have set up any required muxing or other configuration prior to
gpio_request() being called, in order to maintain the same semantics.
This is achieved by gpiolib drivers calling e.g. pinctrl_request_gpio() in
their .request() operation.
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: linux-doc@vger.kernel.org
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'Documentation/gpio.txt')
-rw-r--r-- | Documentation/gpio.txt | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index f783e7fed764..620a07844e8c 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -271,9 +271,26 @@ Some platforms may also use knowledge about what GPIOs are active for | |||
271 | power management, such as by powering down unused chip sectors and, more | 271 | power management, such as by powering down unused chip sectors and, more |
272 | easily, gating off unused clocks. | 272 | easily, gating off unused clocks. |
273 | 273 | ||
274 | Note that requesting a GPIO does NOT cause it to be configured in any | 274 | For GPIOs that use pins known to the pinctrl subsystem, that subsystem should |
275 | way; it just marks that GPIO as in use. Separate code must handle any | 275 | be informed of their use; a gpiolib driver's .request() operation may call |
276 | pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). | 276 | pinctrl_request_gpio(), and a gpiolib driver's .free() operation may call |
277 | pinctrl_free_gpio(). The pinctrl subsystem allows a pinctrl_request_gpio() | ||
278 | to succeed concurrently with a pin or pingroup being "owned" by a device for | ||
279 | pin multiplexing. | ||
280 | |||
281 | Any programming of pin multiplexing hardware that is needed to route the | ||
282 | GPIO signal to the appropriate pin should occur within a GPIO driver's | ||
283 | .direction_input() or .direction_output() operations, and occur after any | ||
284 | setup of an output GPIO's value. This allows a glitch-free migration from a | ||
285 | pin's special function to GPIO. This is sometimes required when using a GPIO | ||
286 | to implement a workaround on signals typically driven by a non-GPIO HW block. | ||
287 | |||
288 | Some platforms allow some or all GPIO signals to be routed to different pins. | ||
289 | Similarly, other aspects of the GPIO or pin may need to be configured, such as | ||
290 | pullup/pulldown. Platform software should arrange that any such details are | ||
291 | configured prior to gpio_request() being called for those GPIOs, e.g. using | ||
292 | the pinctrl subsystem's mapping table, so that GPIO users need not be aware | ||
293 | of these details. | ||
277 | 294 | ||
278 | Also note that it's your responsibility to have stopped using a GPIO | 295 | Also note that it's your responsibility to have stopped using a GPIO |
279 | before you free it. | 296 | before you free it. |