From: Jon Hunter <jon-hunter@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Javier Martinez Canillas <martinez.javier@gmail.com>,
Stephen Warren <swarren@nvidia.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Kevin Hilman <khilman@deeprootsystems.com>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
Grant Likely <grant.likely@secretlab.ca>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: omap: IORESOURCE_IRQ flags not set when defining a GPIO-IRQ from DT
Date: Fri, 1 Mar 2013 16:41:37 -0600 [thread overview]
Message-ID: <51312EA1.8000600@ti.com> (raw)
In-Reply-To: <20130301173001.GC30923@n2100.arm.linux.org.uk>
On 03/01/2013 11:30 AM, Russell King - ARM Linux wrote:
> On Fri, Mar 01, 2013 at 05:17:57PM +0100, Javier Martinez Canillas wrote:
>>>> unsigned long irq_flags = SMC_IRQ_FLAGS;
>>>> ...
>>>> if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK)
>>>> irq_flags = ires->flags & IRQF_TRIGGER_MASK;
>>>>
>>>> while smsc911x driver's probe function uses the flags from the
>>>> resource unconditionally:
>>>>
>>>> irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
>>>>
>>>> So, at the end both will set irq_flags to whatever is on the
>>>> IORESOURCE_IRQ struct resource flags member.
>>>
>>> Actually, that's not the case for smc91x. By default SMC_IRQ_FLAGS != -1
>>> (for omap) and so it will not set irq_flags to ires->flags &
>>> IRQF_TRIGGER_MASK. However, if I force irq_flags to be -1, then I see
>>> that irq_flags are to 0.
>
> smc91x is complicated by the fact that it started off life before there
> was any possibility to pass IRQ flags through resources. So we ended
> up with smc91x.h containing _lots_ of platform specific data, and the
> driver could only be built for one platform.
>
> I fixed that by sorting out this IRQ passing method, and changing smc91x
> to support both the fixed configuration, and the dynamic-through-IRQflags
> method.
>
> There is no reason for any other driver to support the fixed method; that
> would be a completely backwards step.
Thanks for the history. For OMAP I see SMC_IRQ_FLAGS getting defined as
follows in smc91x.h ...
#ifndef SMC_IRQ_FLAGS
#define SMC_IRQ_FLAGS IRQF_TRIGGER_RISING
#endif
And so for OMAP devices using smc91x, it is always being configured as
rising-edge. So it would be good to move OMAP to use a dynamic
configuration too.
Cheers
Jon
next prev parent reply other threads:[~2013-03-01 22:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-01 16:17 omap: IORESOURCE_IRQ flags not set when defining a GPIO-IRQ from DT Javier Martinez Canillas
2013-03-01 17:30 ` Russell King - ARM Linux
2013-03-01 22:41 ` Jon Hunter [this message]
2013-03-02 0:00 ` Russell King - ARM Linux
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=51312EA1.8000600@ti.com \
--to=jon-hunter@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=khilman@deeprootsystems.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=martinez.javier@gmail.com \
--cc=swarren@nvidia.com \
--cc=swarren@wwwdotorg.org \
/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).