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

Commit 1a5eeaa3 authored by Sudheer Papothi's avatar Sudheer Papothi
Browse files

ASoC: msm8998: Add support for ANC headset detection



ANC(Active Noise Cancellation) headset is used for better
audio quality. Add support for ANC headset detection on
MSM8998 target.

Change-Id: I083a84010f8e744dd9fd6e3acf4776257beeb533
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 2aa89ab3
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -514,6 +514,8 @@ static struct wcd_mbhc_config wcd_mbhc_cfg = {
	.key_code[7] = 0,
	.linein_th = 5000,
	.moisture_en = true,
	.anc_micbias = MIC_BIAS_2,
	.enable_anc_mic_detect = false,
};

static struct snd_soc_dapm_route wcd_audio_paths_tasha[] = {
@@ -6844,15 +6846,20 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
			pdev->dev.of_node->full_name);
		dev_dbg(&pdev->dev, "Jack type properties set to default");
	} else {
		if (!strcmp(mbhc_audio_jack_type, "4-pole-jack"))
		if (!strcmp(mbhc_audio_jack_type, "4-pole-jack")) {
			wcd_mbhc_cfg.enable_anc_mic_detect = false;
			dev_dbg(&pdev->dev, "This hardware has 4 pole jack");
		else if (!strcmp(mbhc_audio_jack_type, "5-pole-jack"))
		} else if (!strcmp(mbhc_audio_jack_type, "5-pole-jack")) {
			wcd_mbhc_cfg.enable_anc_mic_detect = true;
			dev_dbg(&pdev->dev, "This hardware has 5 pole jack");
		else if (!strcmp(mbhc_audio_jack_type, "6-pole-jack"))
		} else if (!strcmp(mbhc_audio_jack_type, "6-pole-jack")) {
			wcd_mbhc_cfg.enable_anc_mic_detect = true;
			dev_dbg(&pdev->dev, "This hardware has 6 pole jack");
		else
		} else {
			wcd_mbhc_cfg.enable_anc_mic_detect = false;
			dev_dbg(&pdev->dev, "Unknown value, set to default");
		}
	}
	/*
	 * Parse US-Euro gpio info from DT. Report no error if us-euro
	 * entry is not found in DT file as some targets do not support