Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e616877 authored by Mark Brown's avatar Mark Brown
Browse files

extcon: arizona: Disable debouce for accessory removal detection



Ensure we clamp as quickly as possible after removal by disabling the
debounce while there is an accessory present.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 689557d3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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);