[alsa-devel] [PATCH 12/15] ASoC: twl6040: Enable plug detection interrupts
From: Misael Lopez Cruz misael.lopez@ti.com
Enable plug detection interrupt mask in order to get headset PLUGINT/UNPLUGINT interrupts.
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Margarita Olaya Cabrera magi.olaya@ti.com --- sound/soc/codecs/twl6040.c | 10 +++------- sound/soc/codecs/twl6040.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 17a8715..bfb8dec 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1589,7 +1589,7 @@ static int twl6040_probe(struct snd_soc_codec *codec) struct twl6040_data *priv; int audpwron, naudint; int ret = 0; - u8 icrev; + u8 icrev, intmr = TWL6040_ALLINT_MSK;
priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); if (priv == NULL) @@ -1629,16 +1629,12 @@ static int twl6040_probe(struct snd_soc_codec *codec) priv->codec_powered = 0;
/* enable only codec ready interrupt */ - twl6040_write(codec, TWL6040_REG_INTMR, - ~TWL6040_READYMSK & TWL6040_ALLINT_MSK); + intmr &= ~(TWL6040_READYMSK | TWL6040_PLUGMSK);
/* reset interrupt status to allow correct power up sequence */ twl6040_read_reg_volatile(codec, TWL6040_REG_INTID); - } else { - /* no interrupts at all */ - twl6040_write_reg_cache(codec, TWL6040_REG_INTMR, - TWL6040_ALLINT_MSK); } + twl6040_write(codec, TWL6040_REG_INTMR, intmr);
if (naudint) { /* audio interrupt */ diff --git a/sound/soc/codecs/twl6040.h b/sound/soc/codecs/twl6040.h index 5456c18..1b48857 100644 --- a/sound/soc/codecs/twl6040.h +++ b/sound/soc/codecs/twl6040.h @@ -79,6 +79,7 @@
/* INTMR (0x04) fields */
+#define TWL6040_PLUGMSK 0x02 #define TWL6040_READYMSK 0x40 #define TWL6040_ALLINT_MSK 0x7B
On Mon, Dec 06, 2010 at 06:18:15PM -0600, Olaya, Margarita wrote:
From: Misael Lopez Cruz misael.lopez@ti.com
Enable plug detection interrupt mask in order to get headset PLUGINT/UNPLUGINT interrupts.
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Margarita Olaya Cabrera magi.olaya@ti.com
Might it not be better to enable these interrupts only if the board has set up jack detection? Otherwise you'll just get interrupts that don't serve any purpose which is a waste of time/power.
On Tue, Dec 07, 2010 at 01:34:17PM +0000, Mark Brown wrote:
On Mon, Dec 06, 2010 at 06:18:15PM -0600, Olaya, Margarita wrote:
From: Misael Lopez Cruz misael.lopez@ti.com
Enable plug detection interrupt mask in order to get headset PLUGINT/UNPLUGINT interrupts.
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Margarita Olaya Cabrera magi.olaya@ti.com
Might it not be better to enable these interrupts only if the board has set up jack detection? Otherwise you'll just get interrupts that don't serve any purpose which is a waste of time/power.
Sorry, meant to ack this though:
Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com
participants (2)
-
Mark Brown
-
Olaya, Margarita