Lines Matching refs:GPIO

1 GPIO Descriptor Driver Interface
4 This document serves as a guide for GPIO chip drivers writers. Note that it
6 deprecated integer-based GPIO interface please refer to gpio-legacy.txt.
8 Each GPIO controller driver needs to include the following header, which defines
9 the structures used to define a GPIO driver:
17 Inside a GPIO driver, individual GPIOs are identified by their hardware number,
20 GPIO descriptor is never made visible outside of the driver.
22 On top of this internal number, each GPIO also need to have a global number in
23 the integer GPIO namespace so that it can be used with the legacy GPIO
25 assigned), and for each GPIO the global number will be (base + hardware number).
31 numbers 0..63 with one set of GPIO controllers, 64-79 with another type of GPIO
34 identify GPIOs in a bank of I2C GPIO expanders.
40 In the gpiolib framework each GPIO controller is packaged as a "struct
44 - methods to establish GPIO direction
45 - methods used to access GPIO values
46 - method to return the IRQ number associated to a given GPIO
54 gpio_chip and issue gpiochip_add(). Removing a GPIO controller should be rare;
58 exposed by the GPIO interfaces, such as addressing, power management, and more.
59 Chips such as codecs will have complex non-GPIO state.
63 NULL or the label associated with that GPIO when it was requested.
66 GPIO drivers providing IRQs
68 It is custom that GPIO drivers (GPIO chips) are also providing interrupts,
70 cases the GPIO logic is melded with a SoC's primary interrupt controller.
72 The IRQ portions of the GPIO block are implemented using an irqchip, using
76 GPIO irqchips usually fall in one of two categories:
78 * CHAINED GPIO irqchips: these are usually the type that is embedded on
81 system interrupt controller. This means the GPIO irqchip is registered
83 gpiochip_set_chained_irqchip() helper function, and the GPIO irqchip
85 holding the IRQs disabled. The GPIO irqchip will then end up calling
93 Chained GPIO irqchips typically can NOT set the .can_sleep flag on
96 * NESTED THREADED GPIO irqchips: these are off-chip GPIO expanders and any
97 other GPIO irqchip residing on the other side of a sleeping bus. Of course
109 The hallmark of threaded GPIO irqchips is that they set the .can_sleep
113 To help out in handling the set-up and management of GPIO irqchips and the
137 if that is a combined GPIO+IRQ driver. The basic premise is that gpio_chip and
142 certain GPIO line and should not be relied upon to have been called before
146 callbacks from the GPIO and irqchip APIs. Do not rely on gpiod_to_irq() having
151 GPIO line and register for example) it needs to deny certain operations and
159 to mark the GPIO as being used as an IRQ:
163 This will prevent the use of non-irq related GPIO APIs until the GPIO IRQ lock
168 When implementing an irqchip inside a GPIO driver, these two functions should
173 Requesting self-owned GPIO pins
176 Sometimes it is useful to allow a GPIO chip driver to request its own GPIO
179 try_module_get()). A GPIO driver can use the following functions instead