linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Fabio Estevam <festevam@gmail.com>,
	sameo@linux.intel.com, ashish.jangam@kpitcummins.com,
	dchen@diasemi.com, kernel@pengutronix.de,
	linux-kernel@vger.kernel.org,
	Fabio Estevam <fabio.estevam@freescale.com>
Subject: Re: [PATCH 2/6] mfd: da9052: Introduce da9052-irq.c
Date: Thu, 4 Oct 2012 12:14:12 +0100	[thread overview]
Message-ID: <20121004111412.GJ4360@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <201210040712.48516.arnd@arndb.de>

On Thu, Oct 04, 2012 at 07:12:48AM +0000, Arnd Bergmann wrote:
> On Thursday 04 October 2012, Fabio Estevam wrote:

> > +int da9052_enable_irq(struct da9052 *da9052, int irq)
> > +{
> > +       irq = da9052_map_irq(da9052, irq);
> > +       if (irq < 0)
> > +               return irq;
> > +
> > +       enable_irq(irq);
> > +
> > +       return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(da9052_enable_irq);

> This looks correct, but I'm not sure it's actually simpler
> than letting the sub-drivers deal with calling regmap_irq_get_virq().

> Can't each driver just call regmap_irq_get_virq once at init time and
> then call the regular irq management functions?

> Maybe I just don't see the real purpose of these functions. If I'm
> contradicting what Mark said, listen to him instead.

Aside from hiding the lookup of the irqdomian a bit there's a couple of
reasons for existing devices having them:

 - With some devices like WM8994 the interrupts are optional so it's
   useful to eat errors due to the interrupts not existing.  With the
   ability to use linear domains this doesn't matter terribly much as we
   can just allocate the interrupts even if there's no way they can
   fire, it was more of an issue when irqdomain wasn't available.

 - With Arizona we've actually got a bunch of interrupt controllers the
   interrupts might be allocated to and these functions allow us to hide
   this mapping from the subdrivers.  This is pretty specialist though.

but if the interrupts are always requestable it really makes little
odds, just a matter of taste.

  reply	other threads:[~2012-10-04 11:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04  3:15 [PATCH 1/6] mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe Fabio Estevam
2012-10-04  3:15 ` [PATCH 2/6] mfd: da9052: Introduce da9052-irq.c Fabio Estevam
2012-10-04  7:12   ` Arnd Bergmann
2012-10-04 11:14     ` Mark Brown [this message]
2012-10-04 12:17       ` Arnd Bergmann
2012-10-04 11:25   ` Mark Brown
2012-10-04  3:15 ` [PATCH 3/6] Input: da9052_tsi.c: Fix interrupt handling Fabio Estevam
2012-10-04  3:15 ` [PATCH 4/6] Input: da9052_onkey.c: Convert to the new da9052 interrupt functions Fabio Estevam
2012-10-05 18:57   ` Mark Brown
2012-10-04  3:15 ` [PATCH 5/6] power: da9052-battery: " Fabio Estevam
2012-10-05 18:58   ` Mark Brown
2012-11-18  4:20   ` Anton Vorontsov
2012-11-18 12:30     ` Fabio Estevam
2012-10-04  3:15 ` [PATCH 6/6] gpio: gpio-da9052: " Fabio Estevam
2012-10-04 11:26   ` Mark Brown
2012-10-08  6:20   ` Linus Walleij
2012-10-08 10:40     ` Fabio Estevam
2012-10-09 12:04       ` Linus Walleij
2012-10-09 12:19         ` Fabio Estevam
2012-10-04 11:26 ` [PATCH 1/6] mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe Mark Brown
2012-11-12 16:22   ` Fabio Estevam
2012-11-18 23:44 ` Samuel Ortiz

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=20121004111412.GJ4360@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=arnd@arndb.de \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=dchen@diasemi.com \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.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).