All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 02/16] ASoC: twl6040: Modify the IRQ handler
@ 2010-12-11  3:05 Olaya, Margarita
  2010-12-11 11:20 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Olaya, Margarita @ 2010-12-11  3:05 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel@alsa-project.org

Multiples interrupts can be received. The irq handler is modified
to attend all of them.

Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
---
 sound/soc/codecs/twl6040.c |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index d33d2b4..8a6c623 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -441,30 +441,24 @@ static irqreturn_t twl6040_naudint_handler(int irq, void *data)
 
 	twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &intid, TWL6040_REG_INTID);
 
-	switch (intid) {
-	case TWL6040_THINT:
+	if (intid & TWL6040_THINT)
 		dev_alert(codec->dev, "die temp over-limit detection\n");
-		break;
-	case TWL6040_PLUGINT:
-	case TWL6040_UNPLUGINT:
+
+	if ((intid & TWL6040_PLUGINT) || (intid & TWL6040_UNPLUGINT))
 		queue_delayed_work(priv->workqueue, &priv->delayed_work,
 							msecs_to_jiffies(200));
-		break;
-	case TWL6040_HOOKINT:
-		break;
-	case TWL6040_HFINT:
+
+	if (intid & TWL6040_HOOKINT)
+		dev_info(codec->dev, "hook detection\n");
+
+	if (intid & TWL6040_HFINT)
 		dev_alert(codec->dev, "hf drivers over current detection\n");
-		break;
-	case TWL6040_VIBINT:
+
+	if (intid & TWL6040_VIBINT)
 		dev_alert(codec->dev, "vib drivers over current detection\n");
-		break;
-	case TWL6040_READYINT:
+
+	if (intid & TWL6040_READYINT)
 		complete(&priv->ready);
-		break;
-	default:
-		dev_err(codec->dev, "unknown audio interrupt %d\n", intid);
-		break;
-	}
 
 	return IRQ_HANDLED;
 }
-- 
1.7.0.4

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

* Re: [PATCH v2 02/16] ASoC: twl6040: Modify the IRQ handler
  2010-12-11  3:05 [PATCH v2 02/16] ASoC: twl6040: Modify the IRQ handler Olaya, Margarita
@ 2010-12-11 11:20 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-12-11 11:20 UTC (permalink / raw)
  To: Olaya, Margarita; +Cc: alsa-devel@alsa-project.org, Liam Girdwood

On Fri, Dec 10, 2010 at 09:05:30PM -0600, Olaya, Margarita wrote:
> Multiples interrupts can be received. The irq handler is modified
> to attend all of them.
> 
> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> -	case TWL6040_PLUGINT:
> -	case TWL6040_UNPLUGINT:
> +
> +	if ((intid & TWL6040_PLUGINT) || (intid & TWL6040_UNPLUGINT))
>  		queue_delayed_work(priv->workqueue, &priv->delayed_work,
>  							msecs_to_jiffies(200));
> -		break;

This is going to collide with your previous patch series to enable jack
detection.

> +	if (intid & TWL6040_HOOKINT)
> +		dev_info(codec->dev, "hook detection\n");
> +

This should be reported via the jack detection API - this would
generally be shown as a button to userspace.

>  
>  	return IRQ_HANDLED;
>  }

I'd still expect to see this only flagged if at least one of the
interrupt sources fired.

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

end of thread, other threads:[~2010-12-11 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-11  3:05 [PATCH v2 02/16] ASoC: twl6040: Modify the IRQ handler Olaya, Margarita
2010-12-11 11:20 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.