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

Commit 4c78c1ab authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati Committed by Matt Wagantall
Browse files

ASoC: wcd9335: Enable efuse sensing



Codec efuse control needs to be enabled for correct
functioning of the wcd9335 codec. Write codec register
to enable efuse control.

Change-Id: I24999bf074b4abd6e2344208fe3b2fee7814e624
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 43653bc0
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -345,6 +345,28 @@ struct tasha_priv {
	int swr_clk_users;
};

int tasha_enable_efuse_sensing(struct snd_soc_codec *codec)
{
	tasha_cdc_mclk_enable(codec, true, false);

	snd_soc_update_bits(codec, WCD9335_CHIP_TIER_CTRL_EFUSE_CTL,
			    0x1E, 0x02);
	snd_soc_update_bits(codec, WCD9335_CHIP_TIER_CTRL_EFUSE_CTL,
			    0x01, 0x01);
	/*
	 * 5ms sleep required after enabling efuse control
	 * before checking the status.
	 */
	usleep_range(5000, 5500);
	if (!(snd_soc_read(codec, WCD9335_CHIP_TIER_CTRL_EFUSE_STATUS) & 0x01))
		WARN(1, "%s: Efuse sense is not complete\n", __func__);

	tasha_cdc_mclk_enable(codec, false, false);

	return 0;
}
EXPORT_SYMBOL(tasha_enable_efuse_sensing);

void *tasha_get_afe_config(struct snd_soc_codec *codec,
			   enum afe_config_type config_type)
{
+1 −0
Original line number Diff line number Diff line
@@ -98,4 +98,5 @@ extern void *tasha_get_afe_config(struct snd_soc_codec *codec,
				  enum afe_config_type config_type);
extern int tasha_cdc_mclk_enable(struct snd_soc_codec *codec, bool enable,
				 bool dapm);
extern int tasha_enable_efuse_sensing(struct snd_soc_codec *codec);
#endif