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

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

Merge "ASoC: msm: Add changes for TDM mic mute GPIO"

parents 55458140 532e1127
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2191,6 +2191,9 @@ Optional properties:
- qcom,tdm-i2s-switch-enable: For chipsets where tdm mics are controlled by
			      switch, drive corresponding gpio to output high
			      to enable switch.
- qcom,tdm-mic-mute-enable: This property is used to mute/unmute TDM mics using
				gpio, drive corresponding gpio to output low
				to unmute TDM mics.

Example:
	sound {
+19 −0
Original line number Diff line number Diff line
@@ -2804,6 +2804,7 @@ static int apq8009_asoc_machine_probe(struct platform_device *pdev)
	const char *mclk = "qcom,msm-mclk-freq";
	const char *type = NULL;
	int ret, id;
	int tdm_mic_mute_enable = -EINVAL;

	pdata = devm_kzalloc(&pdev->dev,
			sizeof(struct apq8009_asoc_mach_data), GFP_KERNEL);
@@ -2917,6 +2918,24 @@ static int apq8009_asoc_machine_probe(struct platform_device *pdev)
			"qcom,tdm-i2s-switch-enable",
			pdev->dev.of_node->full_name);

	tdm_mic_mute_enable = of_get_named_gpio(pdev->dev.of_node,
				"qcom,tdm-mic-mute-enable", 0);
	if (tdm_mic_mute_enable >= 0) {
		dev_dbg(&pdev->dev, "%s: tdm mic mute gpio %d\n", __func__,
			tdm_mic_mute_enable);
		ret = gpio_request(tdm_mic_mute_enable, "TDM_MIC");
		if (ret) {
			pr_err("%s: Failed to request gpio\n", __func__);
			goto err;
		}
		/* Pull down GPIO to unmute TDM mics */
		gpio_direction_output(tdm_mic_mute_enable, 0);
	} else {
		dev_err(&pdev->dev, "Looking up %s property in node %s failed\n",
			"qcom,tdm-mic-mute-enable",
			pdev->dev.of_node->full_name);
	}

	return 0;
err:
	if (pdata->vaddr_gpio_mux_spkr_ctl)