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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux