public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mfd: asic3: Avoid unbalanced irq wakeup enables/disables
@ 2012-04-10 23:35 Paul Parsons
  2012-04-16 16:40 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Parsons @ 2012-04-10 23:35 UTC (permalink / raw)
  To: sameo; +Cc: linux-kernel, philipp.zabel

The mfd/asic3 driver does not currently define a irq_set_wake() handler.
Consequently any attempt to configure the 3 ASIC3 GPIO buttons - RECORD,
CALENDAR, HOME - as wakeup sources results in Unbalanced IRQ warnings
when the system is woken from sleep mode:

WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 342 wake disable
...
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 337 wake disable
...
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 339 wake disable
...

This patch adds a irq_set_wake() handler to the mfd/asic3 driver.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
---

V2:
This patch now adds asic3_gpio_irq_set_wake() to mfd/asic3 instead of
disabling the 3 ASIC3 GPIO buttons as wakeup sources in pxa/hx4700.
This patch now submitted to linux-kernel instead of linux-arm-kernel.
Rebased from linux-2.6.39-rc6 to linux-3.4-rc2.

 drivers/mfd/asic3.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 4bf02a8..f5a8b3a 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -353,12 +353,28 @@ static int asic3_gpio_irq_type(struct irq_data *data, unsigned int type)
 	return 0;
 }
 
+static int asic3_gpio_irq_set_wake(struct irq_data *data, unsigned int on)
+{
+	struct asic3 *asic = irq_data_get_irq_chip_data(data);
+	u32 bank, index;
+	u16 bit;
+
+	bank = asic3_irq_to_bank(asic, data->irq);
+	index = asic3_irq_to_index(asic, data->irq);
+	bit = 1<<index;
+
+	asic3_set_register(asic, bank + ASIC3_GPIO_SLEEP_MASK, bit, !on);
+
+	return 0;
+}
+
 static struct irq_chip asic3_gpio_irq_chip = {
 	.name		= "ASIC3-GPIO",
 	.irq_ack	= asic3_mask_gpio_irq,
 	.irq_mask	= asic3_mask_gpio_irq,
 	.irq_unmask	= asic3_unmask_gpio_irq,
 	.irq_set_type	= asic3_gpio_irq_type,
+	.irq_set_wake	= asic3_gpio_irq_set_wake,
 };
 
 static struct irq_chip asic3_irq_chip = {
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mfd: asic3: Avoid unbalanced irq wakeup enables/disables
  2012-04-10 23:35 [PATCH v2] mfd: asic3: Avoid unbalanced irq wakeup enables/disables Paul Parsons
@ 2012-04-16 16:40 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-04-16 16:40 UTC (permalink / raw)
  To: Paul Parsons; +Cc: linux-kernel, philipp.zabel

Hi Paul,

On Wed, Apr 11, 2012 at 12:35:34AM +0100, Paul Parsons wrote:
> The mfd/asic3 driver does not currently define a irq_set_wake() handler.
> Consequently any attempt to configure the 3 ASIC3 GPIO buttons - RECORD,
> CALENDAR, HOME - as wakeup sources results in Unbalanced IRQ warnings
> when the system is woken from sleep mode:
> 
> WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
> Unbalanced IRQ 342 wake disable
> ...
> WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
> Unbalanced IRQ 337 wake disable
> ...
> WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
> Unbalanced IRQ 339 wake disable
> ...
> 
> This patch adds a irq_set_wake() handler to the mfd/asic3 driver.
> 
> Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
> Cc: Philipp Zabel <philipp.zabel@gmail.com>
> ---
> 
> V2:
> This patch now adds asic3_gpio_irq_set_wake() to mfd/asic3 instead of
> disabling the 3 ASIC3 GPIO buttons as wakeup sources in pxa/hx4700.
> This patch now submitted to linux-kernel instead of linux-arm-kernel.
> Rebased from linux-2.6.39-rc6 to linux-3.4-rc2.
Thanks, patch applied as well.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-16 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 23:35 [PATCH v2] mfd: asic3: Avoid unbalanced irq wakeup enables/disables Paul Parsons
2012-04-16 16:40 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox