Skip to content

Commit

Permalink
ASoC: twl6040: Modify the IRQ handler
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Olaya, Margarita authored and Liam Girdwood committed Dec 14, 2010
1 parent 0dec1ec commit cf370a5
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions sound/soc/codecs/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cf370a5

Please sign in to comment.