summaryrefslogtreecommitdiff
path: root/drivers/misc/irq-uclass.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-17 08:04:48 -0400
committerTom Rini <trini@konsulko.com>2020-07-17 08:04:48 -0400
commit7c3cc6f106ed1ca13b0ff6eea9f8e1473240aef3 (patch)
tree8c67a8ed3ab24b1421161960103d8614cbde659a /drivers/misc/irq-uclass.c
parent42e7659db0ac7089d3a2f80ee1c3b8eb64d84706 (diff)
parentd40d2c570600396b54dece16429727ef50cfeef0 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
- New timer API to allow delays with a 32-bit microsecond timer - Add dynamic ACPI structs (DSDT/SSDT) generations to the DM core - x86: Enable ACPI table generation by default - x86: Enable the copy framebuffer on Coral - x86: A few fixes to FSP2 with ApolloLake - x86: Drop setup_pcat_compatibility() - x86: Primary-to-Sideband Bus minor fixes
Diffstat (limited to 'drivers/misc/irq-uclass.c')
-rw-r--r--drivers/misc/irq-uclass.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/misc/irq-uclass.c b/drivers/misc/irq-uclass.c
index ec70866cc3e..94fa233f193 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;
@@ -170,11 +168,27 @@ int irq_first_device_type(enum irq_dev_t type, struct udevice **devp)
ret = uclass_first_device_drvdata(UCLASS_IRQ, type, devp);
if (ret)
- return log_msg_ret("find", ret);
+ return ret;
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",