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

Commit 68bb43c8 authored by vincent_tew's avatar vincent_tew Committed by Harshit Jain
Browse files

sound: codec: improve impedance sense accuracy and change debounce time



1. increse impedance ramp to 2x
2. change debounce time to 512ms

BUG: 30227745

Change-Id: I8d3408e7e8946478484e711be5df63aff2dc9622
Signed-off-by: default avatarvincent_tew <vincent_tew@htc.com>
parent b4c809c1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -590,7 +590,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,

		mbhc->hph_type = WCD_MBHC_HPH_NONE;
		mbhc->zl = mbhc->zr = 0;
		pr_debug("%s: Reporting removal %d(%x)\n", __func__,
		pr_info("%s: Reporting removal %d(%x)\n", __func__,
			 jack_type, mbhc->hph_status);
		wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
				mbhc->hph_status, WCD_MBHC_JACK_MASK);
@@ -1413,8 +1413,8 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
		/* Insertion debounce set to 48ms */
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 4);
	} else {
		/* Insertion debounce set to 96ms */
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 6);
		/* Insertion debounce set to 512ms */
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 0x0B);
	}

	/* Button Debounce set to 16ms */
+3 −3
Original line number Diff line number Diff line
@@ -705,7 +705,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,

		mbhc->hph_type = WCD_MBHC_HPH_NONE;
		mbhc->zl = mbhc->zr = 0;
		pr_debug("%s: Reporting removal %d(%x)\n", __func__,
		pr_info("%s: Reporting removal %d(%x)\n", __func__,
			 jack_type, mbhc->hph_status);

		if (mbhc->mbhc_cb->mbhc_mute_hs_tx &&
@@ -1520,8 +1520,8 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
		/* Insertion debounce set to 48ms */
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 4);
	} else {
		/* Insertion debounce set to 256ms */
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 9);
		/* Insertion debounce set to 512ms */
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 0x0B);
	}

	/* Button Debounce set to 16ms */
+1 −1
Original line number Diff line number Diff line
@@ -1800,7 +1800,7 @@ static void tasha_wcd_mbhc_calc_impedance(struct wcd_mbhc *mbhc, uint32_t *zl,
		{4, 0, 4, 0x08, 0x14, 0x18}, /* < 32ohm */
		{2, 0, 3, 0x18, 0x7C, 0x90}, /* 32ohm < Z < 400ohm */
		{1, 4, 5, 0x18, 0x7C, 0x90}, /* 400ohm < Z < 1200ohm */
		{1, 6, 7, 0x18, 0x7C, 0x90}, /* >1200ohm */
		{2, 6, 7, 0x18, 0x7C, 0x90}, /* >1200ohm */
	};
	struct tasha_mbhc_zdet_param *zdet_param_ptr = NULL;
	s16 d1_a[][4] = {