Commit 4f44ee1f authored by Misael Lopez Cruz's avatar Misael Lopez Cruz Committed by Liam Girdwood

ASoC: twl6040: Enable plug detection interrupts

Enable plug detection interrupt mask in order to get headset
PLUGINT/UNPLUGINT interrupts.
Signed-off-by: default avatarMisael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: default avatarMargarita Olaya Cabrera <magi.olaya@ti.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent f1f489a6
...@@ -1108,7 +1108,7 @@ static int twl6040_probe(struct snd_soc_codec *codec) ...@@ -1108,7 +1108,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
struct twl6040_data *priv; struct twl6040_data *priv;
int audpwron, naudint; int audpwron, naudint;
int ret = 0; int ret = 0;
u8 icrev; u8 icrev, intmr = TWL6040_ALLINT_MSK;
priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
if (priv == NULL) if (priv == NULL)
...@@ -1154,16 +1154,12 @@ static int twl6040_probe(struct snd_soc_codec *codec) ...@@ -1154,16 +1154,12 @@ static int twl6040_probe(struct snd_soc_codec *codec)
priv->codec_powered = 0; priv->codec_powered = 0;
/* enable only codec ready interrupt */ /* enable only codec ready interrupt */
twl6040_write(codec, TWL6040_REG_INTMR, intmr &= ~(TWL6040_READYMSK | TWL6040_PLUGMSK);
~TWL6040_READYMSK & TWL6040_ALLINT_MSK);
/* reset interrupt status to allow correct power up sequence */ /* reset interrupt status to allow correct power up sequence */
twl6040_read_reg_volatile(codec, TWL6040_REG_INTID); 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) { if (naudint) {
/* audio interrupt */ /* audio interrupt */
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
/* INTMR (0x04) fields */ /* INTMR (0x04) fields */
#define TWL6040_PLUGMSK 0x02
#define TWL6040_READYMSK 0x40 #define TWL6040_READYMSK 0x40
#define TWL6040_ALLINT_MSK 0x7B #define TWL6040_ALLINT_MSK 0x7B
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment