Lines Matching +full:first +full:- +full:data +full:- +full:gpios
1 /* SPDX-License-Identifier: GPL-2.0 */
10 #include <linux/pinctrl/pinconf-generic.h>
46 * struct gpio_irq_chip - GPIO interrupt controller
76 * If non-NULL, will be set as the parent of this GPIO interrupt
88 * hardware IRQs correspond to the GPIO index 0..ngpio-1 (see the
96 * HWIRQ, return -EINVAL, but also make sure to fill in @valid_mask and
111 * &gpiochip_populate_parent_fwspec_twocell will be used. A four-cell
185 * single pointer used as the data associated with every
195 * different data for each parent. This cannot be NULL if
234 * sized array to be used as parent data.
268 * bits from 0..(ngpios-1) set to "1" as in valid. The callback can
279 * If not %NULL, holds bitmask of GPIOs which are valid to be included
285 * @first:
290 unsigned int first; member
297 void (*irq_enable)(struct irq_data *data);
304 void (*irq_disable)(struct irq_data *data);
310 void (*irq_unmask)(struct irq_data *data);
317 void (*irq_mask)(struct irq_data *data);
321 * struct gpio_chip - abstract a GPIO controller
323 * number or the name of the SoC IP-block implementing it.
325 * @parent: optional parent device providing the GPIOs
327 * @owner: helps prevent removal of modules exporting active GPIOs
328 * @request: optional hook for chip-specific activation, such as
330 * @free: optional hook for chip-specific deactivation, such as
335 * function, even on input-only or output-only gpio chips.
337 * This can be omitted on input-only or output-only gpio chips.
339 * This can be omitted on input-only or output-only gpio chips.
347 * @to_irq: optional hook supporting non-static gpiod_to_irq() mappings;
353 * not all GPIOs are valid.
361 * @base: identifies the first GPIO number handled by this chip;
363 * DEPRECATION: providing anything non-negative and nailing the base
364 * offset of GPIO chips is deprecated. Please pass -1 as base to
367 * @ngpio: the number of GPIOs handled by this controller; the last GPIO
368 * handled is (base + ngpio - 1).
373 * names for the GPIOs in this chip. Any entry in the array
388 * @reg_dat: data (in) register for generic GPIO
397 * @bgpio_lock: used to lock chip->bgpio_data. Also, this is needed to keep
398 * shadowed and real data registers writes together.
399 * @bgpio_data: shadowed data register for generic GPIO to clear/set bits
405 * A gpio_chip can help platforms abstract various sources of GPIOs so
411 * by "offset" values in the range 0..(@ngpio - 1). When those signals
471 void (*write_reg)(void __iomem *reg, unsigned long data);
503 * If not %NULL, holds bitmask of GPIOs which are valid to be used
524 * Callback to translate a device tree GPIO specifier into a chip-
536 * for_each_requested_gpio_in_range - iterates over requested GPIOs in a given range
539 * @base: first GPIO in the range
540 * @size: amount of GPIOs to check starting from @base
549 for_each_requested_gpio_in_range(chip, i, 0, chip->ngpio, label)
552 extern int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
557 * gpiochip_add_data() - register a gpio_chip
558 * @gc: the chip to register, with gc->base initialized
559 * @data: driver-private data associated with this chip
563 * When gpiochip_add_data() is called very early during boot, so that GPIOs
564 * can be freely used, the gc->parent device must be registered before
566 * for GPIOs will fail rudely.
571 * If gc->base is negative, this requests dynamic assignment of
572 * a range of valid GPIOs.
576 * gc->base is invalid or already associated with a different chip.
580 #define gpiochip_add_data(gc, data) ({ \ argument
583 gpiochip_add_data_with_key(gc, data, &lock_key, \
586 #define devm_gpiochip_add_data(dev, gc, data) ({ \ argument
589 devm_gpiochip_add_data_with_key(dev, gc, data, &lock_key, \
593 #define gpiochip_add_data(gc, data) gpiochip_add_data_with_key(gc, data, NULL, NULL) argument
594 #define devm_gpiochip_add_data(dev, gc, data) \ argument
595 devm_gpiochip_add_data_with_key(dev, gc, data, NULL, NULL)
603 extern int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc, void *data,
607 extern struct gpio_chip *gpiochip_find(void *data,
608 int (*match)(struct gpio_chip *gc, void *data));
610 struct gpio_device *gpio_device_find(void *data,
611 int (*match)(struct gpio_chip *gc, void *data));
623 int gpiochip_irq_reqres(struct irq_data *data);
624 void gpiochip_irq_relres(struct irq_data *data);
635 girq->chip = (struct irq_chip *)chip; in gpio_irq_chip_set_chip()
646 /* get driver data */
686 struct irq_data *data, bool reserve);
688 struct irq_data *data);
705 return -EINVAL; in gpiochip_irqchip_add_domain()
715 * struct gpio_pin_range - pin range controlled by a gpio chip
786 return ERR_PTR(-ENODEV); in gpiod_to_chip()
793 return -EINVAL; in gpiochip_lock_as_irq()
805 if (!fwnode_property_present(child, "gpio-controller")) {} else