summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/gsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/gsi.c')
-rw-r--r--drivers/acpi/gsi.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
index 2c39fe1216e2..202a8fee77dc 100644
--- a/drivers/acpi/gsi.c
+++ b/drivers/acpi/gsi.c
@@ -75,12 +75,21 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
{
unsigned int irq;
unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity);
- struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
- DOMAIN_BUS_ANY);
- irq = irq_create_mapping(d, gsi);
- if (!irq)
- return -EINVAL;
+ if (acpi_gsi_domain_id) {
+ struct irq_fwspec fwspec;
+
+ fwspec.fwnode = acpi_gsi_domain_id;
+ fwspec.param[0] = gsi;
+ fwspec.param[1] = irq_type;
+ fwspec.param_count = 2;
+
+ return irq_create_fwspec_mapping(&fwspec);
+ } else {
+ irq = irq_create_mapping(NULL, gsi);
+ if (!irq)
+ return -EINVAL;
+ }
/* Set irq type if specified and different than the current one */
if (irq_type != IRQ_TYPE_NONE &&
@@ -103,3 +112,16 @@ void acpi_unregister_gsi(u32 gsi)
irq_dispose_mapping(irq);
}
EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
+
+/**
+ * acpi_set_irq_model - Setup the GSI irqdomain information
+ * @model: the value assigned to acpi_irq_model
+ * @fwnode: the irq_domain identifier for mapping and looking up
+ * GSI interrupts
+ */
+void __init acpi_set_irq_model(enum acpi_irq_model_id model,
+ struct fwnode_handle *fwnode)
+{
+ acpi_irq_model = model;
+ acpi_gsi_domain_id = fwnode;
+}