diff options
author | Agustin Vega-Frias <agustinv@codeaurora.org> | 2017-02-02 18:23:58 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2017-02-03 10:03:48 -0500 |
commit | d44fa3d46079dc095c1346fa6e5bc96dca1ead41 (patch) | |
tree | 6c2880d745b366a4a024e3048e6727873a43b773 /drivers/base/platform.c | |
parent | fa20b176f609c813d2c677f54c814cbb7ea5f1d1 (diff) |
ACPI: Add support for ResourceSource/IRQ domain mapping
ACPI extended IRQ resources may contain a ResourceSource to specify
an alternate interrupt controller. Introduce acpi_irq_get and use it
to implement ResourceSource/IRQ domain mapping.
The new API is similar to of_irq_get and allows re-initialization
of a platform resource from the ACPI extended IRQ resource, and
provides proper behavior for probe deferral when the domain is not
yet present when called.
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Agustin Vega-Frias <agustinv@codeaurora.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index c4af00385502..647e4761dbf3 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -102,6 +102,16 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | r = platform_get_resource(dev, IORESOURCE_IRQ, num); | 104 | r = platform_get_resource(dev, IORESOURCE_IRQ, num); |
105 | if (has_acpi_companion(&dev->dev)) { | ||
106 | if (r && r->flags & IORESOURCE_DISABLED) { | ||
107 | int ret; | ||
108 | |||
109 | ret = acpi_irq_get(ACPI_HANDLE(&dev->dev), num, r); | ||
110 | if (ret) | ||
111 | return ret; | ||
112 | } | ||
113 | } | ||
114 | |||
105 | /* | 115 | /* |
106 | * The resources may pass trigger flags to the irqs that need | 116 | * The resources may pass trigger flags to the irqs that need |
107 | * to be set up. It so happens that the trigger flags for | 117 | * to be set up. It so happens that the trigger flags for |