]> Pileus Git - ~andy/linux/commitdiff
extcon: arizona: Fix reset of HPDET after race with removal
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thu, 14 Nov 2013 16:18:22 +0000 (16:18 +0000)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 7 Jan 2014 02:54:28 +0000 (11:54 +0900)
We need to make sure we reset back to our starting state, especially
making sure that we have disabled poll in the register cache.

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

index 5775f055bd0213391627d8ebf47413dcd02b5098..fefb8563db9eb760a1941483092b535022225e14 100644 (file)
@@ -603,9 +603,15 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
                dev_err(arizona->dev, "Failed to report HP/line: %d\n",
                        ret);
 
+done:
+       /* Reset back to starting range */
+       regmap_update_bits(arizona->regmap,
+                          ARIZONA_HEADPHONE_DETECT_1,
+                          ARIZONA_HP_IMPEDANCE_RANGE_MASK | ARIZONA_HP_POLL,
+                          0);
+
        arizona_extcon_do_magic(info, 0);
 
-done:
        if (id_gpio)
                gpio_set_value_cansleep(id_gpio, 0);