From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Grant Likely <grant.likely@linaro.org>
Cc: Mark Brown <broonie@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: How to create IRQ mappings in a GPIO driver that doesn't control its IRQ domain ?
Date: Wed, 31 Jul 2013 13:14:47 +0200 [thread overview]
Message-ID: <26968517.tbY84mICFD@avalon> (raw)
In-Reply-To: <20130728050021.4370E3E0A24@localhost>
Hi Grant,
On Saturday 27 July 2013 23:00:21 Grant Likely wrote:
> On Thu, 25 Jul 2013 15:22:29 +0200, Laurent Pinchart wrote:
> > On Thursday 25 July 2013 14:15:56 Mark Brown wrote:
> > > On Thu, Jul 25, 2013 at 11:45:33AM +0200, Laurent Pinchart wrote:
> > > > The two devices are independent, so there's no real parent/child
> > > > relationship. However, as Grant proposed, I could list all the
> > > > interrupts associated with GPIOs in the GPIO controller DT node. I
> > > > would then just call irq_of_parse_and_map() in the .to_irq() handler
> > > > to magically translate the GPIO number to a mapped IRQ number.
> > > >
> > > > The number of interrupts can be pretty high (up to 58 in the worst
> > > > case so far), so an alternative would be to specify the interrupt-
> > > > parent only, and call irq_create_of_mapping() directly. What solution
> > > > would you prefer ?
> > >
> > > Are the interrupts in a contiguous block in the controller so you can
> > > just pass around the controller and a base number?
> >
> > In two of the three SoCs I need to fix they are. I've just realized that
> > in the last one the interrupts are in two contiguous blocks in two
> > different parents. I will thus need at least a list of <parent-phandle
> > base count>.
> >
> > Our standard interrupt bindings don't seem to support multiple parents,
>
> You can actually do it by using a dummy node with interrupt-map and
> interrupt-map-mask properties, but it is a pretty ugly solution in my
> opinion.
>
> > is that something that we want to fix or should I go for custom bindings ?
>
> Yes, I think it is something that we want to fix. Jean-Christophe was going
> to propose an alternative to the interrupts property which allows an array
> of <phandle interrupt-specifier> tuples, but I've not seen anything yet. Go
> ahead and make a proposal.
More work, great :-)
A bit of bikeshedding here, as the "interrupts" property is already used, how
should I name the new property ?
> You could try to encode a base+count variant, but honestly I don't think it
> would be a good idea because it only would work with a very narrow set of
> use cases. Consider if #interrupt-cells was set to 2. Which cell gets
> incremented in the range of interrupts specified? Better I think to merely
> have an array of fully specified irqs. Support for that property could be
> transparently baked into the core interrupt parsing functions.
I agree, I'll try that.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-07-31 11:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 23:21 How to create IRQ mappings in a GPIO driver that doesn't control its IRQ domain ? Laurent Pinchart
2013-07-24 20:24 ` Grant Likely
2013-07-25 9:42 ` Laurent Pinchart
2013-07-25 9:20 ` Linus Walleij
2013-07-25 9:45 ` Laurent Pinchart
2013-07-25 13:15 ` Mark Brown
2013-07-25 13:21 ` Linus Walleij
2013-07-25 13:53 ` Mark Brown
2013-07-25 13:22 ` Laurent Pinchart
2013-07-25 13:55 ` Mark Brown
2013-07-28 5:00 ` Grant Likely
2013-07-31 11:14 ` Laurent Pinchart [this message]
2013-07-25 13:19 ` Linus Walleij
2013-07-28 10:07 ` Tomasz Figa
2013-07-31 11:11 ` Laurent Pinchart
2013-07-31 11:29 ` Tomasz Figa
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=26968517.tbY84mICFD@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=benh@kernel.crashing.org \
--cc=broonie@kernel.org \
--cc=g.liakhovetski@gmx.de \
--cc=grant.likely@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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