Re: [PATCH 1/4] MFD: palmas PMIC device support

From: Mark Brown
Date: Mon May 14 2012 - 06:33:37 EST


On Mon, May 14, 2012 at 07:26:31PM +0900, Graeme Gregory wrote:
> On 14/05/12 17:28, Mark Brown wrote:
> > On Mon, May 14, 2012 at 10:58:29AM +0900, Graeme Gregory wrote:

> >> drivers/mfd/palmas-irq.c | 241 +++++

> > The IRQ support here seems to be following a pretty common pattern for
> > dense IRQ maps - could we factor it out into regmap-irq? It'd also be
> > nice if it were using an irq_domain - while it's far from essential it
> > is something Grant has been pushing and I believe it'll be required when
> > you do device tree support.

> The IRQ map is not dense. It is split into 4 registers which are not
> contiguous. I think the overhead of translating to 4 reqmap irqs would
> negate the point of using regmap irq. I can add to TODO to add this
> handling to regmap_irq.

If the register blocks are nicely spaced we can probably find a
framework way to do this.

> I am confused on the whole irq_domain business, is it replacement for
> sparse irq? I don't see many users in drivers/mfd and not much
> Documentation.

regmap-irq in -next as of today has an example of using them for this
type of device (and of course half the point of regmap-irq is that it
avoids individual drivers needing to worry so much about things like
this, they can just use data!). I also posted a patch for wm831x though
that's got a bunch of noise in the function drivers due to passing the
interrupt numbers through as resources, the core should be fairly clear
though and is a bit more direct.

Attachment: signature.asc
Description: Digital signature