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

Commit 979b3111 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoc: wcd: correct handling of L_DET_EN and pull down switches"

parents d4b63712 0874210c
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -898,6 +898,11 @@ static int wcd_check_cross_conn(struct wcd_mbhc *mbhc)
		if (mbhc->mbhc_cb->hph_pa_on_status(mbhc->codec))
			return false;

	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_L_DET_EN, 0);

	if (mbhc->mbhc_cb->hph_pull_down_ctrl)
		mbhc->mbhc_cb->hph_pull_down_ctrl(mbhc->codec, false);

	WCD_MBHC_REG_READ(WCD_MBHC_ELECT_SCHMT_ISRC, reg1);
	/*
	 * Check if there is any cross connection,
@@ -931,6 +936,11 @@ static int wcd_check_cross_conn(struct wcd_mbhc *mbhc)
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_ELECT_SCHMT_ISRC, reg1);
	pr_debug("%s: leave, plug type: %d\n", __func__,  plug_type);

	if (mbhc->mbhc_cb->hph_pull_down_ctrl)
		mbhc->mbhc_cb->hph_pull_down_ctrl(mbhc->codec, true);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_L_DET_EN, 1);


	return (plug_type == MBHC_PLUG_TYPE_GND_MIC_SWAP) ? true : false;
}

@@ -1459,9 +1469,6 @@ static void wcd_mbhc_detect_plug_type(struct wcd_mbhc *mbhc)
	pr_debug("%s: enter\n", __func__);
	WCD_MBHC_RSC_ASSERT_LOCKED(mbhc);

	if (mbhc->mbhc_cb->hph_pull_down_ctrl)
		mbhc->mbhc_cb->hph_pull_down_ctrl(codec, false);

	if (mbhc->mbhc_cb->micbias_enable_status)
		micbias1 = mbhc->mbhc_cb->micbias_enable_status(mbhc,
								MIC_BIAS_1);
+6 −0
Original line number Diff line number Diff line
@@ -1813,6 +1813,9 @@ static void tasha_wcd_mbhc_calc_impedance(struct wcd_mbhc *mbhc, uint32_t *zl,
		wcd9xxx_reg_update_bits(&wcd9xxx->core_res,
					WCD9335_ANA_MBHC_MECH, 0x80, 0x00);

	if (mbhc->mbhc_cb->hph_pull_down_ctrl)
		mbhc->mbhc_cb->hph_pull_down_ctrl(codec, false);

	/* Enable AZ */
	snd_soc_update_bits(codec, WCD9335_MBHC_CTL_1, 0x0C, 0x04);
	/* Turn off 100k pull down on HPHL */
@@ -1935,6 +1938,9 @@ zdet_complete:
	wcd9xxx_reg_update_bits(&wcd9xxx->core_res,
				WCD9335_ANA_MBHC_MECH, 0x01, 0x01);

	if (mbhc->mbhc_cb->hph_pull_down_ctrl)
		mbhc->mbhc_cb->hph_pull_down_ctrl(codec, true);

	/* For NO-jack, re-enable L_DET_EN after Z-det measurements */
	if (mbhc->hphl_swh)
		wcd9xxx_reg_update_bits(&wcd9xxx->core_res,