[alsa-devel] [PATCH 2/3] ASoC: rt298: clear IRQ at the beginning of rt298_irq

Bard Liao bardliao at realtek.com
Tue Feb 16 10:12:35 CET 2016


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 at 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;
-- 
1.8.1.1.439.g50a6b54



More information about the Alsa-devel mailing list