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

Commit f3cf965f authored by Kuirong Wang's avatar Kuirong Wang
Browse files

ASoC: wcd9330: Add qfuse sensing function for wcd9330



Add Qfuse sensing function for wcd9330 so that qfuse data
registers will get updated with correct values which will
then be used for other codec functionalities.

Change-Id: I69c9bb00f0fc094e5d49d7c970ebf090e1ba2352
CRs-fixed: 665318
Signed-off-by: default avatarKuirong Wang <kuirongw@codeaurora.org>
parent 3bb9501c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -7388,6 +7388,20 @@ int tomtom_enable_cpe(struct snd_soc_codec *codec)
}
EXPORT_SYMBOL(tomtom_enable_cpe);

int tomtom_enable_qfuse_sensing(struct snd_soc_codec *codec)
{
	snd_soc_write(codec, TOMTOM_A_QFUSE_CTL, 0x03);
	/*
	 * 5ms sleep required after enabling qfuse control
	 * before checking the status.
	 */
	usleep_range(5000, 5500);
	if ((snd_soc_read(codec, TOMTOM_A_QFUSE_STATUS) & (0x03)) != 0x03)
		WARN(1, "%s: Qfuse sense is not complete\n", __func__);
	return 0;
}
EXPORT_SYMBOL(tomtom_enable_qfuse_sensing);

static int tomtom_codec_probe(struct snd_soc_codec *codec)
{
	struct wcd9xxx *control;
+1 −0
Original line number Diff line number Diff line
@@ -117,4 +117,5 @@ extern void tomtom_register_ext_clk_cb(
	int (*get_ext_clk_cnt) (void),
	struct snd_soc_codec *codec);
extern int tomtom_enable_cpe(struct snd_soc_codec *codec);
extern int tomtom_enable_qfuse_sensing(struct snd_soc_codec *codec);
#endif