extcon: arizona: Clear jack status regardless of detection type
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 9 Dec 2019 11:09:10 +0000 (11:09 +0000)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 9 Dec 2019 11:18:14 +0000 (20:18 +0900)
It makes sense to clear the internal state of the jack detection
regardless of if the headphone detect based accessory detection or
the normal microphone detect based flow is used.

No issues are currently known because of this but the change makes
more logical sense and eases future refactoring of the code.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-arizona.c

index 121c4170694786b005217928daba203a3f791717..11f1d753aa1021b63d04ec45aaa00d118791b45b 100644 (file)
@@ -1154,11 +1154,11 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
                        dev_err(arizona->dev, "Mechanical report failed: %d\n",
                                ret);
 
-               if (!arizona->pdata.hpdet_acc_id) {
-                       info->detecting = true;
-                       info->mic = false;
-                       info->jack_flips = 0;
+               info->detecting = true;
+               info->mic = false;
+               info->jack_flips = 0;
 
+               if (!arizona->pdata.hpdet_acc_id) {
                        arizona_start_mic(info);
                } else {
                        queue_delayed_work(system_power_efficient_wq,