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

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

Merge "asoc: msmnile: add usbc analog handle parsing"

parents c33373ce a29178a0
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/input.h>
#include <linux/of_device.h>
#include <linux/pm_qos.h>
#include <linux/soc/qcom/fsa4480-i2c.h>
#include <sound/core.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
@@ -165,6 +166,7 @@ struct msm_asoc_mach_data {
	struct device_node *us_euro_gpio_p; /* used by pinctrl API */
	struct device_node *hph_en1_gpio_p; /* used by pinctrl API */
	struct device_node *hph_en0_gpio_p; /* used by pinctrl API */
	struct device_node *fsa_handle;
};

struct msm_asoc_wcd93xx_codec {
@@ -3581,7 +3583,14 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,

static bool msm_usbc_swap_gnd_mic(struct snd_soc_codec *codec, bool active)
{
	struct snd_soc_card *card = codec->component.card;
	struct msm_asoc_mach_data *pdata =
				snd_soc_card_get_drvdata(card);

	if (!pdata->fsa_handle)
		return false;

	return fsa4480_switch_event(pdata->fsa_handle, FSA_MIC_GND_SWAP);
}

static bool msm_swap_gnd_mic(struct snd_soc_codec *codec, bool active)
@@ -7293,6 +7302,12 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
			"qcom,us-euro-gpios");
		wcd_mbhc_cfg.swap_gnd_mic = msm_swap_gnd_mic;
	}
	pdata->fsa_handle = of_parse_phandle(pdev->dev.of_node,
					     "fsa4480-i2c-handle", 0);
	if (!pdata->fsa_handle)
		dev_dbg(&pdev->dev, "property %s not detected in node %s\n",
			"fsa4480-i2c-handle", pdev->dev.of_node->full_name);

	/* Parse pinctrl info from devicetree */
	ret = msm_get_pinctrl(pdev);
	if (!ret) {