1 /* SPDX-License-Identifier: GPL-2.0 */
3 * IRQ is a type of interrupt controller used on recent Intel SoC.
5 * Copyright 2019 Google LLC
12 * struct irq_ops - Operations for the IRQ
16 * route_pmc_gpio_gpe() - Get the GPIO for an event
19 * @pmc_gpe_num: Event number to check
20 * @returns GPIO for the event, or -ENOENT if none
22 int (*route_pmc_gpio_gpe)(struct udevice *dev, uint pmc_gpe_num);
25 * set_polarity() - Set the IRQ polarity
28 * @irq: Interrupt number to set
29 * @active_low: true if active low, false for active high
30 * @return 0 if OK, -EINVAL if @irq is invalid
32 int (*set_polarity)(struct udevice *dev, uint irq, bool active_low);
35 * snapshot_polarities() - record IRQ polarities for later restore
40 int (*snapshot_polarities)(struct udevice *dev);
43 * restore_polarities() - restore IRQ polarities
48 int (*restore_polarities)(struct udevice *dev);
51 #define irq_get_ops(dev) ((struct irq_ops *)(dev)->driver->ops)
54 * irq_route_pmc_gpio_gpe() - Get the GPIO for an event
57 * @pmc_gpe_num: Event number to check
58 * @returns GPIO for the event, or -ENOENT if none
60 int irq_route_pmc_gpio_gpe(struct udevice *dev, uint pmc_gpe_num);
63 * irq_set_polarity() - Set the IRQ polarity
66 * @irq: Interrupt number to set
67 * @active_low: true if active low, false for active high
68 * @return 0 if OK, -EINVAL if @irq is invalid
70 int irq_set_polarity(struct udevice *dev, uint irq, bool active_low);
73 * irq_snapshot_polarities() - record IRQ polarities for later restore
78 int irq_snapshot_polarities(struct udevice *dev);
81 * irq_restore_polarities() - restore IRQ polarities
86 int irq_restore_polarities(struct udevice *dev);