[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5011BF90.5030708@wwwdotorg.org>
Date: Thu, 26 Jul 2012 16:07:12 -0600
From: Stephen Warren <swarren@...dotorg.org>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC: Samuel Ortiz <sameo@...ux.intel.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Liam Girdwood <lrg@...com>, linux-kernel@...r.kernel.org,
devicetree-discuss@...ts.ozlabs.org,
Gyungoh Yoo <jack.yoo@...im-ic.com>,
Stephen Warren <swarren@...dia.com>
Subject: Re: [PATCH] mfd: add MAX8907 core driver
On 07/26/2012 02:35 PM, Mark Brown wrote:
> On Thu, Jul 26, 2012 at 01:40:30PM -0600, Stephen Warren wrote:
>> + if (irqd_is_wakeup_set(d)) {
>> + /* 1 -- disable, 0 -- enable */
>> + switch (irq_data->mask_reg) {
>
> This loop we should just port over into the regmap code.
I assume the best way of doing this is to add new functions
regmap_irq_suspend()/regmap_irq_resume() (which would mask any enabled
interrupts that were not wake enabled); that way, the regmap_irq code
can loop over each register and just write it once. An alternative might
be to implement struct irq_chip's .irq_suspend/.irq_resume ops, but that
might worst-case end up with an I2C write per interrupt.
I see that the MAX8907 IRQ code does this in suspend:
if (device_may_wakeup(chip->dev))
enable_irq_wake(i2c->irq);
else
disable_irq(i2c->irq);
and this in resume:
if (device_may_wakeup(chip->dev))
disable_irq_wake(i2c->irq);
else
enable_irq(i2c->irq);
neither of which are done in regmap_irq, since it doesn't explicitly do
anything for suspend/resume at the moment. Are those code blocks
necessary? I see that regmap_irq_sync_unlock() is already calling
irq_set_irq_wake(), which implies that suspend/resume may have already
been completely taken care of?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists