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

Commit b2551a99 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: enable TDM mics with gpio controlled"

parents 68086899 3b2df3a4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1997,6 +1997,9 @@ Optional properties:
- qcom,wsa-devs: This property contains list of wsa codec names. The names
		should comply with the wsa nodes configurations.
- qcom,wsa-aux-dev-prefix: This property contains list of wsa codec prefixes.
- qcom,tdm-i2s-switch-enable: For chipsets where tdm mics are controlled by
			      switch, drive corresponding gpio to output high
			      to enable switch.

Example:
	sound {
+19 −1
Original line number Diff line number Diff line
 /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 /* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -2733,6 +2733,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_i2s_switch_enable = -EINVAL;

	pdata = devm_kzalloc(&pdev->dev,
			sizeof(struct apq8009_asoc_mach_data), GFP_KERNEL);
@@ -2830,6 +2831,23 @@ static int apq8009_asoc_machine_probe(struct platform_device *pdev)
				ret);
		goto err;
	}

	tdm_i2s_switch_enable = of_get_named_gpio(pdev->dev.of_node,
				"qcom,tdm-i2s-switch-enable", 0);
	if (tdm_i2s_switch_enable >= 0) {
		dev_dbg(&pdev->dev, "%s: tdm switch gpio %d", __func__,
			tdm_i2s_switch_enable);
		ret = gpio_request(tdm_i2s_switch_enable, "TDM_RESET");
		if (ret) {
			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",
			pdev->dev.of_node->full_name);

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