This API is similar to DT based irq_of_parse_and_map but does link parent/child IRQ controllers. This is tested for primary GIC PPI and GIC SPI interrupts and not for secondary child irq controllers.
Signed-off-by: Amit Daniel Kachhap amit.daniel@samsung.com --- drivers/acpi/plat/arm/boot.c | 27 ++++++++++++++++++++++++--- 1 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/plat/arm/boot.c b/drivers/acpi/plat/arm/boot.c index 7aa98d4..5521695 100644 --- a/drivers/acpi/plat/arm/boot.c +++ b/drivers/acpi/plat/arm/boot.c @@ -255,6 +255,7 @@ static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi, int (*__acpi_register_gsi)(struct device *dev, u32 gsi, int trigger, int polarity) = acpi_register_gsi_pic;
+#define MAX_SPECIFIER_SIZE 4 /* * success: return IRQ number (>=0) * failure: return < 0 @@ -263,11 +264,31 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity) { unsigned int irq; unsigned int plat_gsi = gsi; + u32 specifier[MAX_SPECIFIER_SIZE];
- plat_gsi = (*__acpi_register_gsi)(dev, gsi, trigger, polarity); - - irq = gsi_to_irq(plat_gsi); + memset(specifier, 0, sizeof(specifier)); + if (gsi <= 32) { + /* PPI interrupt */ + specifier[0] = 1; + }
+ specifier[1] = gsi; + if (trigger == ACPI_EDGE_SENSITIVE && + polarity == ACPI_ACTIVE_LOW) + specifier[2] = IRQ_TYPE_EDGE_FALLING; + else if (trigger == ACPI_EDGE_SENSITIVE && + polarity == ACPI_ACTIVE_HIGH) + specifier[2] = IRQ_TYPE_EDGE_RISING; + else if (trigger == ACPI_LEVEL_SENSITIVE && + polarity == ACPI_ACTIVE_LOW) + specifier[2] = IRQ_TYPE_LEVEL_LOW; + else if (trigger == ACPI_LEVEL_SENSITIVE && + polarity == ACPI_ACTIVE_HIGH) + specifier[2] = IRQ_TYPE_LEVEL_HIGH; + else + specifier[2] = IRQ_TYPE_NONE; + + irq = irq_create_default_mapping(specifier, 3); return irq; } EXPORT_SYMBOL_GPL(acpi_register_gsi);