Lines Matching refs:GPIO

2 GPIO Descriptor Driver Interface
5 This document serves as a guide for GPIO chip drivers writers. Note that it
7 deprecated integer-based GPIO interface please refer to gpio-legacy.txt.
9 Each GPIO controller driver needs to include the following header, which defines
10 the structures used to define a GPIO driver:
18 Inside a GPIO driver, individual GPIOs are identified by their hardware number,
21 GPIO descriptor is never made visible outside of the driver.
23 On top of this internal number, each GPIO also need to have a global number in
24 the integer GPIO namespace so that it can be used with the legacy GPIO
26 assigned), and for each GPIO the global number will be (base + hardware number).
32 numbers 0..63 with one set of GPIO controllers, 64-79 with another type of GPIO
35 identify GPIOs in a bank of I2C GPIO expanders.
41 In the gpiolib framework each GPIO controller is packaged as a "struct
45 - methods to establish GPIO line direction
46 - methods used to access GPIO line values
47 - method to set electrical configuration for a given GPIO line
48 - method to return the IRQ number associated to a given GPIO line
53 - optional label for diagnostics and GPIO chip mapping using platform data
58 Removing a GPIO controller should be rare; use ``[devm_]gpiochip_remove()``
62 exposed by the GPIO interfaces, such as addressing, power management, and more.
63 Chips such as audio codecs will have complex non-GPIO states.
67 NULL or the label associated with that GPIO when it was requested.
69 RT_FULL: the GPIO driver should not use spinlock_t or any sleepable APIs
71 control callbacks) if it is expected to call GPIO APIs from atomic context
76 GPIO electrical configuration
88 ending up in the pin control back-end "behind" the GPIO controller, usually
90 listed GPIO configurations.
92 If a pin controller back-end is used, the GPIO controller or hardware
93 description needs to provide "GPIO ranges" mapping the GPIO line offsets to pin
135 - inverse wire-OR on an I/O line, for example a GPIO line, making it possible
166 The desired output signal (e.g. coming directly from some GPIO output register)
177 Some GPIO hardware come in open drain / open source configuration. Some are
197 If this state can not be configured in hardware, i.e. if the GPIO hardware does
198 not support open drain/open source in hardware, the GPIO library will instead
211 GPIO drivers providing IRQs
213 It is custom that GPIO drivers (GPIO chips) are also providing interrupts,
215 cases the GPIO logic is melded with a SoC's primary interrupt controller.
217 The IRQ portions of the GPIO block are implemented using an irqchip, using
221 RT_FULL: a realtime compliant GPIO driver should not use spinlock_t or any
229 GPIO irqchips usually fall in one of two categories:
231 * CHAINED GPIO irqchips: these are usually the type that is embedded on
234 system interrupt controller. This means that the GPIO irqchip handler will
236 disabled. The GPIO irqchip will then end up calling something like this
244 Chained GPIO irqchips typically can NOT set the .can_sleep flag on
251 If required (and if it can't be converted to the nested threaded GPIO irqchip)
266 * GENERIC CHAINED GPIO irqchips: these are the same as "CHAINED GPIO irqchips",
267 but chained IRQ handlers are not used. Instead GPIO IRQs dispatching is
269 The GPIO irqchip will then end up calling something like this sequence in
273 for each detected GPIO IRQ
278 the same W/A as for "CHAINED GPIO irqchips" can be applied.
280 * NESTED THREADED GPIO irqchips: these are off-chip GPIO expanders and any
281 other GPIO irqchip residing on the other side of a sleeping bus. Of course
293 The hallmark of threaded GPIO irqchips is that they set the .can_sleep
297 To help out in handling the set-up and management of GPIO irqchips and the
336 expected for GPIO driver that irqchip .set_type() callback have to be called
337 before using/enabling GPIO IRQ. Then set the handler to handle_level_irq()
342 if that is a combined GPIO+IRQ driver. The basic premise is that gpio_chip and
347 certain GPIO line and should not be relied upon to have been called before
351 callbacks from the GPIO and irqchip APIs. Do not rely on gpiod_to_irq() having
356 GPIO line and register for example) it needs to deny certain operations and
364 to mark the GPIO as being used as an IRQ::
368 This will prevent the use of non-irq related GPIO APIs until the GPIO IRQ lock
373 When implementing an irqchip inside a GPIO driver, these two functions should
380 Real-Time compliance for GPIO IRQ chips
384 preemption. It is desirable that all irqchips in the GPIO subsystem keep this
394 - Chained GPIO irqchips: ensure spinlock_t or any sleepable APIs are not used
396 - Generic chained GPIO irqchips: take care about generic_handle_irq() calls and
398 - Chained GPIO irqchips: get rid of chained IRQ handler and use generic irq
401 GPIO IRQ chip implementation;
406 Requesting self-owned GPIO pins
409 Sometimes it is useful to allow a GPIO chip driver to request its own GPIO
412 try_module_get()). A GPIO driver can use the following functions instead