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

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

Merge "ASoC: wcd9335: set codec TX path to tri-state"

parents b2551a99 c7848141
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -536,6 +536,10 @@ Tasha audio CODEC in I2C mode

 - qcom,cdc-dmic-sample-rate - Specifies dmic sample rate.
 - qcom,cdc-variant - Specifies codec variant.
 - qcom,wcd9xxx-mic-tristate: For chipsets where I2S TX line is shared between
			      the Codec and TDM mics, tristate the WCD mics to
			      avoid PCM interference as the end product uses
			      only TDM mics.

Example:
i2c_3: i2c@78B7000 { /* BLSP1 QUP3 */
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@@ -2881,6 +2881,8 @@ static struct wcd9xxx_pdata *wcd9xxx_populate_dt_pdata(struct device *dev)
		else
			pdata->cdc_variant = WCD9XXX;
	}
	pdata->wcd9xxx_mic_tristate = of_property_read_bool(dev->of_node,
						 "qcom,wcd9xxx-mic-tristate");

	return pdata;
err:
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@@ -192,6 +192,7 @@ struct wcd9xxx_pdata {
	u32 mic_unmute_delay;
	enum codec_variant cdc_variant;
	u16 use_pinctrl;
	bool wcd9xxx_mic_tristate;
};

#endif
+27 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-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
@@ -851,6 +851,15 @@ static const struct tasha_reg_mask_val tasha_spkr_mode1[] = {
	{WCD9335_CDC_BOOST1_BOOST_CTL, 0x7C, 0x44},
};

static const struct tasha_reg_mask_val tasha_high_impedance[] = {
	{WCD9335_TLMM_I2S_TX_SD0_PINCFG, 0x1F, 0x0C},
	{WCD9335_TLMM_I2S_TX_SD1_PINCFG, 0x1F, 0x0C},
	{WCD9335_TLMM_I2S_TX_SCK_PINCFG, 0x1F, 0x0C},
	{WCD9335_TLMM_I2S_TX_WS_PINCFG, 0x1F, 0x0C},
	{WCD9335_TEST_DEBUG_PIN_CTL_OE_1, 0xE0, 0xE0},
	{WCD9335_TEST_DEBUG_PIN_CTL_OE_2, 0x01, 0x01},
};

/**
 * tasha_set_spkr_gain_offset - offset the speaker path
 * gain with the given offset value.
@@ -954,6 +963,20 @@ static void tasha_cdc_sido_ccl_enable(struct tasha_priv *tasha, bool ccl_flag)
	}
}

static void tasha_set_high_impedance_mode(struct snd_soc_codec *codec)
{
	const struct tasha_reg_mask_val *regs;
	int i, size;

	dev_dbg(codec->dev, "%s: setting TX I2S in Hi-Z mode\n", __func__);
	regs = tasha_high_impedance;
	size = ARRAY_SIZE(tasha_high_impedance);

	for (i = 0; i < size; i++)
		snd_soc_update_bits(codec, regs[i].reg,
				    regs[i].mask, regs[i].val);
}

static bool tasha_cdc_is_svs_enabled(struct tasha_priv *tasha)
{
	if (TASHA_IS_2_0(tasha->wcd9xxx->version) &&
@@ -13941,6 +13964,9 @@ static int tasha_codec_probe(struct snd_soc_codec *codec)
	mutex_unlock(&codec->mutex);
	snd_soc_dapm_sync(dapm);

	if (pdata->wcd9xxx_mic_tristate)
		tasha_set_high_impedance_mode(codec);

	return ret;

err_pdata: