diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 13:11:41 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | f4955137f5f15e615376cf38559414a9b53e3d55 (patch) | |
tree | 699167d9e3cc6cae0fae4a0ddeb4b335c05786aa /drivers/misc/irq-uclass.c | |
parent | 2715b3623c08bf1ad2dfe6076ad86c24e3138016 (diff) | |
download | u-boot-f4955137f5f15e615376cf38559414a9b53e3d55.tar.gz |
irq: Add a method to convert an interrupt to ACPI
When generating ACPI tables we need to convert IRQs in U-Boot to the ACPI
structures required by ACPI. This is a SoC-specific conversion and cannot
be handled by generic code, so add a new IRQ method to do the conversion.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/misc/irq-uclass.c')
-rw-r--r-- | drivers/misc/irq-uclass.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/misc/irq-uclass.c b/drivers/misc/irq-uclass.c index ec70866cc3e..8727a33dd91 100644 --- a/drivers/misc/irq-uclass.c +++ b/drivers/misc/irq-uclass.c @@ -152,8 +152,6 @@ int irq_request(struct udevice *dev, struct irq *irq) const struct irq_ops *ops; log_debug("(dev=%p, irq=%p)\n", dev, irq); - if (!irq) - return 0; ops = irq_get_ops(dev); irq->dev = dev; @@ -175,6 +173,22 @@ int irq_first_device_type(enum irq_dev_t type, struct udevice **devp) return 0; } +#if CONFIG_IS_ENABLED(ACPIGEN) +int irq_get_acpi(const struct irq *irq, struct acpi_irq *acpi_irq) +{ + struct irq_ops *ops; + + if (!irq_is_valid(irq)) + return -EINVAL; + + ops = irq_get_ops(irq->dev); + if (!ops->get_acpi) + return -ENOSYS; + + return ops->get_acpi(irq, acpi_irq); +} +#endif + UCLASS_DRIVER(irq) = { .id = UCLASS_IRQ, .name = "irq", |