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

Commit a7c2858f authored by Xiaoyu Ye's avatar Xiaoyu Ye
Browse files

ASoC: sdm845: Add support for ANC headset detection



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

Change-Id: Ifcafcb1494b36243b6628cc95cacb95ec78edfea
Signed-off-by: default avatarXiaoyu Ye <benyxy@codeaurora.org>
parent 925b2207
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -508,6 +508,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[] = {
@@ -6186,15 +6188,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