Lines Matching +full:irq +full:- +full:gpios

1 /* SPDX-License-Identifier: GPL-2.0 */
12 #include <linux/pinctrl/pinconf-generic.h>
48 * struct gpio_irq_chip - GPIO interrupt controller
54 * GPIO IRQ chip implementation, provided by GPIO driver.
62 * hwirq number and Linux IRQ number.
78 * If non-NULL, will be set as the parent of this GPIO interrupt
79 * controller's IRQ domain to establish a hierarchical interrupt
88 * This callback translates a child hardware IRQ offset to a parent
89 * hardware IRQ offset on a hierarchical interrupt chip. The child
90 * hardware IRQs correspond to the GPIO index 0..ngpio-1 (see the
92 * hardware IRQ and type (such as IRQ_TYPE_*) shall be returned by
98 * HWIRQ, return -EINVAL, but also make sure to fill in @valid_mask and
112 * for the parent's IRQ domain. If this is not specified, then
113 * &gpiochip_populate_parent_fwspec_twocell will be used. A four-cell
126 * offset on the GPIO chip to an IRQ number for the GPIO to_irq()
136 * The IRQ domain operations that will be used for this GPIO IRQ
138 * be populated to setup the IRQ hierarchy. Some drivers need to
147 * The IRQ handler to use (often a predefined IRQ core function) for
155 * Default IRQ triggering type applied during GPIO driver
163 * Per GPIO IRQ chip lockdep class for IRQ lock.
170 * Per GPIO IRQ chip lockdep class for IRQ request.
243 * Flag to track GPIO chip irq member's initialization.
244 * This flag will make sure GPIO chip irq members are not used
259 * an IRQ chip will be added. This is quite useful when
260 * a particular driver wants to clear IRQ related registers
270 * bits from 0..(ngpios-1) set to "1" as in valid. The callback can
281 * If not %NULL, holds bitmask of GPIOs which are valid to be included
282 * in IRQ domain of the chip.
289 * Required for static IRQ allocation. If set, irq_domain_add_simple()
323 * struct gpio_chip - abstract a GPIO controller
325 * number or the name of the SoC IP-block implementing it.
327 * @parent: optional parent device providing the GPIOs
329 * @owner: helps prevent removal of modules exporting active GPIOs
330 * @request: optional hook for chip-specific activation, such as
332 * @free: optional hook for chip-specific deactivation, such as
337 * function, even on input-only or output-only gpio chips.
339 * or a negative error number. This can be omitted on input-only or
340 * output-only gpio chips.
342 * success or a negative error number. This can be omitted on input-only
343 * or output-only gpio chips.
351 * @to_irq: optional hook supporting non-static gpiod_to_irq() mappings;
357 * not all GPIOs are valid.
360 * It is called after adding GPIO chip and before adding IRQ chip.
367 * DEPRECATION: providing anything non-negative and nailing the base
368 * offset of GPIO chips is deprecated. Please pass -1 as base to
371 * @ngpio: the number of GPIOs handled by this controller; the last GPIO
372 * handled is (base + ngpio - 1).
377 * names for the GPIOs in this chip. Any entry in the array
383 * as the chip access may sleep when e.g. reading out the IRQ status
399 * @bgpio_lock: used to lock chip->bgpio_data. Also, this is needed to keep
407 * A gpio_chip can help platforms abstract various sources of GPIOs so
413 * by "offset" values in the range 0..(@ngpio - 1). When those signals
494 * @irq:
499 struct gpio_irq_chip irq; member
505 * If not %NULL, holds bitmask of GPIOs which are valid to be used
526 * Callback to translate a device tree GPIO specifier into a chip-
553 * for_each_hwgpio - Iterates over all GPIOs for given chip.
557 * Set to NULL for unused GPIOs.
561 *_data.i < _chip->ngpio; \
568 * for_each_requested_gpio_in_range - iterates over requested GPIOs in a given range
572 * @_size: amount of GPIOs to check starting from @base
586 for_each_requested_gpio_in_range(chip, i, 0, chip->ngpio, label)
594 * gpiochip_add_data() - register a gpio_chip
595 * @gc: the chip to register, with gc->base initialized
596 * @data: driver-private data associated with this chip
600 * When gpiochip_add_data() is called very early during boot, so that GPIOs
601 * can be freely used, the gc->parent device must be registered before
603 * for GPIOs will fail rudely.
608 * If gc->base is negative, this requests dynamic assignment of
609 * a range of valid GPIOs.
613 * gc->base is invalid or already associated with a different chip.
671 girq->chip = (struct irq_chip *)chip; in gpio_irq_chip_set_chip()
728 return -EINVAL; in gpiochip_irqchip_add_domain()
738 * struct gpio_pin_range - pin range controlled by a gpio chip
797 /* lock/unlock as IRQ */
819 return ERR_PTR(-ENODEV); in gpiod_to_chip()
825 return ERR_PTR(-ENODEV); in gpiod_to_gpio_device()
831 return -ENODEV; in gpio_device_get_base()
856 return -EINVAL; in gpiochip_lock_as_irq()
868 if (!fwnode_property_present(child, "gpio-controller")) {} else