diff options
Diffstat (limited to 'Documentation/gpio')
-rw-r--r-- | Documentation/gpio/driver.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/gpio/driver.txt b/Documentation/gpio/driver.txt index 224dbbcd1804..18790c237977 100644 --- a/Documentation/gpio/driver.txt +++ b/Documentation/gpio/driver.txt | |||
@@ -167,3 +167,24 @@ is released: | |||
167 | When implementing an irqchip inside a GPIO driver, these two functions should | 167 | When implementing an irqchip inside a GPIO driver, these two functions should |
168 | typically be called in the .startup() and .shutdown() callbacks from the | 168 | typically be called in the .startup() and .shutdown() callbacks from the |
169 | irqchip. | 169 | irqchip. |
170 | |||
171 | |||
172 | Requesting self-owned GPIO pins | ||
173 | ------------------------------- | ||
174 | |||
175 | Sometimes it is useful to allow a GPIO chip driver to request its own GPIO | ||
176 | descriptors through the gpiolib API. Using gpio_request() for this purpose | ||
177 | does not help since it pins the module to the kernel forever (it calls | ||
178 | try_module_get()). A GPIO driver can use the following functions instead | ||
179 | to request and free descriptors without being pinned to the kernel forever. | ||
180 | |||
181 | int gpiochip_request_own_desc(struct gpio_desc *desc, const char *label) | ||
182 | |||
183 | void gpiochip_free_own_desc(struct gpio_desc *desc) | ||
184 | |||
185 | Descriptors requested with gpiochip_request_own_desc() must be released with | ||
186 | gpiochip_free_own_desc(). | ||
187 | |||
188 | These functions must be used with care since they do not affect module use | ||
189 | count. Do not use the functions to request gpio descriptors not owned by the | ||
190 | calling driver. | ||