extcon: arizona: Disable debouce for accessory removal detection
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 15 Jan 2013 13:09:20 +0000 (22:09 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 23 Jan 2013 01:31:49 +0000 (09:31 +0800)
Ensure we clamp as quickly as possible after removal by disabling the
debounce while there is an accessory present.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/extcon/extcon-arizona.c

index de141f72c8e5cce51e2ca9b24dd626cc87a49fb1..ce95f8625e8dd84509bc0189a7e1f2ebbbf8947f 100644 (file)
@@ -773,6 +773,10 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
                } else {
                        arizona_start_hpdet_acc_id(info);
                }
+
+               regmap_update_bits(arizona->regmap,
+                                  ARIZONA_JACK_DETECT_DEBOUNCE,
+                                  ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB, 0);
        } else {
                dev_dbg(arizona->dev, "Detected jack removal\n");
 
@@ -792,6 +796,11 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
                if (ret != 0)
                        dev_err(arizona->dev, "Removal report failed: %d\n",
                                ret);
+
+               regmap_update_bits(arizona->regmap,
+                                  ARIZONA_JACK_DETECT_DEBOUNCE,
+                                  ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB,
+                                  ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB);
        }
 
        mutex_unlock(&info->lock);