From: Grant Likely <grant.likely@linaro.org>
To: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
Tomasz Figa <tomasz.figa@gmail.com>
Subject: Re: [PATCH] of: irq: Pass trigger type in IRQ resource flags
Date: Fri, 04 Oct 2013 18:42:19 +0100 [thread overview]
Message-ID: <20131004174219.4EAA3C427FD@trevor.secretlab.ca> (raw)
In-Reply-To: <1380390771-4620-1-git-send-email-tomasz.figa@gmail.com>
On Sat, 28 Sep 2013 19:52:51 +0200, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> Some drivers might rely on availability of trigger flags in IRQ
> resource, for example to configure the hardware for particular interrupt
> type. However current code creating IRQ resources from data in device
> tree does not configure trigger flags in resulting resources.
>
> This patch tries to solve the problem, based on the fact that
> irq_of_parse_and_map() configures the trigger based on DT interrupt
> specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*,
> and we can get correct trigger flags by calling irqd_get_trigger_type()
> after mapping the interrupt.
>
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Applied, thanks.
g.
> ---
> drivers/of/irq.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 1752988..12742d0 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -356,6 +356,16 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
> r->start = r->end = irq;
> r->flags = IORESOURCE_IRQ;
> r->name = name ? name : dev->full_name;
> +
> + /*
> + * Some drivers might rely on availability of trigger flags
> + * in IRQ resource. Since irq_of_parse_and_map() configures the
> + * trigger based on interrupt specifier and IRQD_TRIGGER_*
> + * flags are consistent with IORESOURCE_IRQ_*, we can get
> + * trigger type that was just set and pass it through resource
> + * flags as well.
> + */
> + r->flags |= irqd_get_trigger_type(irq_get_irq_data(irq));
> }
>
> return irq;
> --
> 1.8.3.2
>
next prev parent reply other threads:[~2013-10-04 17:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 17:52 [PATCH] of: irq: Pass trigger type in IRQ resource flags Tomasz Figa
2013-10-04 17:42 ` Grant Likely [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-05-18 22:56 Tomasz Figa
[not found] ` <1368917790-23770-1-git-send-email-tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-05 18:20 ` Tomasz Figa
2013-06-14 22:00 ` Grant Likely
2013-06-15 0:57 ` Javier Martinez Canillas
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=20131004174219.4EAA3C427FD@trevor.secretlab.ca \
--to=grant.likely@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=tomasz.figa@gmail.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;
as well as URLs for NNTP newsgroup(s).