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

Commit 01f5d152 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-mbhc: Add support for mbhc ground detection"

parents 8ee0014d 1d7be653
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1782,11 +1782,13 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
		mbhc->mbhc_cb->hph_pull_up_control(codec, INSERT);
	else
		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_CTRL, 3);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_COMP_CTRL, 1);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_L_DET_EN, 1);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HPHL_PLUG_TYPE, mbhc->hphl_swh);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_GND_PLUG_TYPE, mbhc->gnd_swh);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_SW_HPH_LP_100K_TO_GND, 1);
	if (mbhc->mbhc_cfg->gnd_det_en && mbhc->mbhc_cb->mbhc_gnd_det_ctrl)
		mbhc->mbhc_cb->mbhc_gnd_det_ctrl(codec, true);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_COMP_CTRL, 1);
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_L_DET_EN, 1);

	/* Insertion debounce set to 256ms */
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_INSREM_DBNC, 9);
+2 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ struct wcd_mbhc_config {
	bool mono_stero_detection;
	bool (*swap_gnd_mic)(struct snd_soc_codec *codec);
	bool hs_ext_micbias;
	bool gnd_det_en;
};

struct wcd_mbhc_intr {
@@ -308,6 +309,7 @@ struct wcd_mbhc_cb {
	void (*mbhc_micb_ramp_control)(struct snd_soc_codec *, bool);
	bool (*extn_use_mb)(struct snd_soc_codec *);
	int (*mbhc_micb_ctrl_thr_mic)(struct snd_soc_codec *, int, bool);
	void (*mbhc_gnd_det_ctrl)(struct snd_soc_codec *, bool);
};

struct wcd_mbhc {