From: Grant Likely <grant.likely@linaro.org>
To: Hanjun Guo <hanjun.guo@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Mark Rutland <mark.rutland@arm.com>,
Matthew Garrett <mjg59@srcf.ucam.org>,
linaro-kernel@lists.linaro.org, linux-acpi@vger.kernel.org,
patches@linaro.org, linux-kernel@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
linaro-acpi@lists.linaro.org, Olof Johansson <olof@lixom.net>,
Amit Daniel Kachhap <amit.daniel@samsung.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-arm-kernel@lists.infradead.org,
Hanjun Guo <hanjun.guo@linaro.org>
Subject: Re: [RFC part2 PATCH 8/9] ACPI / ARM64: Update acpi_register_gsi to register with the core IRQ subsystem
Date: Tue, 10 Dec 2013 13:05:21 +0000 [thread overview]
Message-ID: <20131210130521.3FE89C40A27@trevor.secretlab.ca> (raw)
In-Reply-To: <1385999094-3152-9-git-send-email-hanjun.guo@linaro.org>
On Mon, 2 Dec 2013 23:44:53 +0800, Hanjun Guo <hanjun.guo@linaro.org> wrote:
> 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>
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> ---
> drivers/acpi/plat/arm-core.c | 36 ++++++++++++++++++++++++++++++++++--
> 1 file changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/plat/arm-core.c b/drivers/acpi/plat/arm-core.c
> index 9cc0208..17c99e1 100644
> --- a/drivers/acpi/plat/arm-core.c
> +++ b/drivers/acpi/plat/arm-core.c
> @@ -90,7 +90,7 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_GIC;
>
> static unsigned int gsi_to_irq(unsigned int gsi)
> {
> - int irq = irq_create_mapping(NULL, gsi);
> + int irq = irq_find_mapping(NULL, gsi);
I suspect this will break FDT users that depend on the old behaviour.
g.
>
> return irq;
> }
> @@ -407,7 +407,39 @@ EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
> */
> int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
> {
> - return -1;
> + unsigned int irq;
> + unsigned int irq_type;
> +
> + /*
> + * ACPI have no bindings to indicate SPI or PPI, so we
> + * use different mappings from DT in ACPI.
> + *
> + * For FDT
> + * PPI interrupt: in the range [0, 15];
> + * SPI interrupt: in the range [0, 987];
> + *
> + * For ACPI, using identity mapping for hwirq:
> + * PPI interrupt: in the range [16, 31];
> + * SPI interrupt: in the range [32, 1019];
> + */
> +
> + if (trigger == ACPI_EDGE_SENSITIVE &&
> + polarity == ACPI_ACTIVE_LOW)
> + irq_type = IRQ_TYPE_EDGE_FALLING;
> + else if (trigger == ACPI_EDGE_SENSITIVE &&
> + polarity == ACPI_ACTIVE_HIGH)
> + irq_type = IRQ_TYPE_EDGE_RISING;
> + else if (trigger == ACPI_LEVEL_SENSITIVE &&
> + polarity == ACPI_ACTIVE_LOW)
> + irq_type = IRQ_TYPE_LEVEL_LOW;
> + else if (trigger == ACPI_LEVEL_SENSITIVE &&
> + polarity == ACPI_ACTIVE_HIGH)
> + irq_type = IRQ_TYPE_LEVEL_HIGH;
> + else
> + irq_type = IRQ_TYPE_NONE;
> +
> + irq = irq_create_acpi_mapping(gsi, irq_type);
> + return irq;
> }
> EXPORT_SYMBOL_GPL(acpi_register_gsi);
>
> --
> 1.7.9.5
>
>
> _______________________________________________
> linaro-kernel mailing list
> linaro-kernel@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-kernel
next prev parent reply other threads:[~2013-12-10 13:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1385999094-3152-1-git-send-email-hanjun.guo@linaro.org>
[not found] ` < 1385999094-3152-3-git-send-email-hanjun.guo@linaro.org>
[not found] ` <1385999094-3152-3-git-send-email-hanjun.guo@linaro.org>
2013-12-10 12:53 ` [RFC part2 PATCH 2/9] ARM64 / ACPI: Prefill cpu possible/present maps and map logical cpu id to APIC id Grant Likely
2013-12-10 15:07 ` Hanjun Guo
[not found] ` < 1385999094-3152-5-git-send-email-hanjun.guo@linaro.org>
[not found] ` <1385999094-3152-5-git-send-email-hanjun.guo@linaro.org>
2013-12-10 13:03 ` [RFC part2 PATCH 4/9] ARM64 / ACPI: Use Parked Address in GIC structure for spin table SMP initialisation Grant Likely
2013-12-11 7:02 ` Hanjun Guo
[not found] ` < 1385999094-3152-9-git-send-email-hanjun.guo@linaro.org>
[not found] ` <1385999094-3152-9-git-send-email-hanjun.guo@linaro.org>
2013-12-10 13:05 ` Grant Likely [this message]
2013-12-11 5:23 ` [RFC part2 PATCH 8/9] ACPI / ARM64: Update acpi_register_gsi to register with the core IRQ subsystem Arnd Bergmann
2014-01-20 14:36 ` Grant Likely
2013-12-03 16:39 [RFC part2 PATCH 0/9] Using ACPI MADT table to initialise SMP and GIC Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 8/9] ACPI / ARM64: Update acpi_register_gsi to register with the core IRQ subsystem Hanjun Guo
2013-12-05 3:48 ` Arnd Bergmann
2013-12-05 14:01 ` Hanjun Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131210130521.3FE89C40A27@trevor.secretlab.ca \
--to=grant.likely@linaro.org \
--cc=amit.daniel@samsung.com \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=hanjun.guo@linaro.org \
--cc=linaro-acpi@lists.linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mjg59@srcf.ucam.org \
--cc=olof@lixom.net \
--cc=patches@linaro.org \
--cc=rjw@rjwysocki.net \
--cc=rob.herring@calxeda.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®