driver.rst (f632a8170a6b667ee4e3f552087588f0fe13c4bb) driver.rst (fe34c89d25429e079ba67416529514120dd715f8)
1=====================
2GPIO Driver Interface
3=====================
4
5This document serves as a guide for writers of GPIO chip drivers.
6
7Each GPIO controller driver needs to include the following header, which defines
8the structures used to define a GPIO driver:

--- 385 unchanged lines hidden (view full) ---

394associated irqdomain and resource allocation callbacks, the gpiolib has
395some helpers that can be enabled by selecting the GPIOLIB_IRQCHIP Kconfig
396symbol:
397
398- gpiochip_irqchip_add(): adds a chained cascaded irqchip to a gpiochip. It
399 will pass the struct gpio_chip* for the chip to all IRQ callbacks, so the
400 callbacks need to embed the gpio_chip in its state container and obtain a
401 pointer to the container using container_of().
1=====================
2GPIO Driver Interface
3=====================
4
5This document serves as a guide for writers of GPIO chip drivers.
6
7Each GPIO controller driver needs to include the following header, which defines
8the structures used to define a GPIO driver:

--- 385 unchanged lines hidden (view full) ---

394associated irqdomain and resource allocation callbacks, the gpiolib has
395some helpers that can be enabled by selecting the GPIOLIB_IRQCHIP Kconfig
396symbol:
397
398- gpiochip_irqchip_add(): adds a chained cascaded irqchip to a gpiochip. It
399 will pass the struct gpio_chip* for the chip to all IRQ callbacks, so the
400 callbacks need to embed the gpio_chip in its state container and obtain a
401 pointer to the container using container_of().
402 (See Documentation/driver-model/design-patterns.rst)
402 (See Documentation/driver-api/driver-model/design-patterns.rst)
403
404- gpiochip_irqchip_add_nested(): adds a nested cascaded irqchip to a gpiochip,
405 as discussed above regarding different types of cascaded irqchips. The
406 cascaded irq has to be handled by a threaded interrupt handler.
407 Apart from that it works exactly like the chained irqchip.
408
409- gpiochip_set_chained_irqchip(): sets up a chained cascaded irq handler for a
410 gpio_chip from a parent IRQ and passes the struct gpio_chip* as handler

--- 139 unchanged lines hidden ---
403
404- gpiochip_irqchip_add_nested(): adds a nested cascaded irqchip to a gpiochip,
405 as discussed above regarding different types of cascaded irqchips. The
406 cascaded irq has to be handled by a threaded interrupt handler.
407 Apart from that it works exactly like the chained irqchip.
408
409- gpiochip_set_chained_irqchip(): sets up a chained cascaded irq handler for a
410 gpio_chip from a parent IRQ and passes the struct gpio_chip* as handler

--- 139 unchanged lines hidden ---