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

Commit e4bd03bb 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: dynamically control i2s switch gpio"

parents f4330166 8f61c20c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ static int apq8009_auxpcm_rate = 8000;
static atomic_t pri_mi2s_clk_ref;
static atomic_t quat_mi2s_clk_ref;
static atomic_t auxpcm_mi2s_clk_ref;
static int tdm_i2s_switch_enable = -EINVAL;

static int apq8009_enable_extcodec_ext_clk(struct snd_soc_codec *codec,
					int enable, bool dapm);
@@ -1490,6 +1491,9 @@ static int msm_tdm_startup(struct snd_pcm_substream *substream)
		if (ret < 0)
			pr_err("%s: failed to activate primary TDM gpio set\n",
				 __func__);
		/* Enable I2S switch to turn on TDM mics for SOM*/
		if (tdm_i2s_switch_enable >= 0)
			gpio_direction_output(tdm_i2s_switch_enable, 1);
		break;
	default:
		pr_err("dai id 0x%x not supported", cpu_dai->id);
@@ -1527,6 +1531,9 @@ static void msm_tdm_shutdown(struct snd_pcm_substream *substream)
				__func__, "pri_tdm");
			return;
		}

		if (tdm_i2s_switch_enable >= 0)
			gpio_direction_output(tdm_i2s_switch_enable, 0);
		break;
	default:
		break;
@@ -2743,7 +2750,6 @@ 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_i2s_switch_enable = -EINVAL;

	pdata = devm_kzalloc(&pdev->dev,
			sizeof(struct apq8009_asoc_mach_data), GFP_KERNEL);
@@ -2852,7 +2858,6 @@ static int apq8009_asoc_machine_probe(struct platform_device *pdev)
			pr_err("%s: Failed to request gpio\n", __func__);
			goto err;
		}
		gpio_direction_output(tdm_i2s_switch_enable, 1);
	} else
		dev_err(&pdev->dev, "Looking up %s property in node %s failed\n",
			"qcom,tdm-i2s-switch-enable",