The IRQ pin will go from high to low when the irq bit is clear. To let the IRQ pin go low as early as possible, move the clear irq bit function to the beginning of irq handler.
Signed-off-by: Bard Liao bardliao@realtek.com --- sound/soc/codecs/rt298.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index e67ef5f..58bc134 100644 --- a/sound/soc/codecs/rt298.c +++ b/sound/soc/codecs/rt298.c @@ -961,11 +961,11 @@ static irqreturn_t rt298_irq(int irq, void *data) bool mic = false; int ret, status = 0;
- ret = rt298_jack_detect(rt298, &hp, &mic); - /* Clear IRQ */ regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x1, 0x1);
+ ret = rt298_jack_detect(rt298, &hp, &mic); + if (ret == 0) { if (hp == true) status |= SND_JACK_HEADPHONE;