[alsa-devel] [PATCH 02/15] ASoC: twl6040: Modify the IRQ handler
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, 13 insertions(+), 17 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 59018b3..e908146 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -398,27 +398,23 @@ 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: - case TWL6040_HOOKINT: - break; - case TWL6040_HFINT: + + if (intid & TWL6040_PLUGINT) + dev_alert(codec->dev, "headset plug detection\n"); + + if (intid & TWL6040_UNPLUGINT) + dev_alert(codec->dev, "headset unplug 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; }
On Mon, Dec 06, 2010 at 06:17:44PM -0600, Olaya, Margarita wrote:
- if (intid & TWL6040_PLUGINT)
dev_alert(codec->dev, "headset plug detection\n");
- if (intid & TWL6040_UNPLUGINT)
dev_alert(codec->dev, "headset unplug detection\n");
This is where I'd expect to see the jack detection patch adding handling of the IRQ.
dev_alert() seems too much also - it would usually mean that something went seriously wrong (like the over current warnings).
return IRQ_HANDLED; }
I'd expect this only if we actually detected (and therefore handled) an event?
participants (2)
-
Mark Brown
-
Olaya, Margarita