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

Commit d5170189 authored by Rohit Kumar's avatar Rohit Kumar
Browse files

ASoC: sdm660: Initialize codec_reg_done to false



Initialize codec_reg_done to false. Also, set codec_reg_done
to true when audrx_init is successful for either internal or
external codec target.

CRs-Fixed: 2071065
Change-Id: I05dad1aa4d21b3f2b2d81df720594ed81a6cfad1
Signed-off-by: default avatarRohit Kumar <rohitkr@codeaurora.org>
parent 84e196fc
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ enum {
	EXT_DISP_RX_IDX_MAX,
};

bool codec_reg_done;

/* TDM default config */
static struct dev_config tdm_rx_cfg[TDM_INTERFACE_MAX][TDM_PORT_MAX] = {
	{ /* PRI TDM */
@@ -2016,6 +2018,12 @@ int msm_common_snd_controls_size(void)
}
EXPORT_SYMBOL(msm_common_snd_controls_size);

void msm_set_codec_reg_done(bool done)
{
	codec_reg_done = done;
}
EXPORT_SYMBOL(msm_set_codec_reg_done);

static inline int param_is_mask(int p)
{
	return (p >= SNDRV_PCM_HW_PARAM_FIRST_MASK) &&
@@ -3044,6 +3052,7 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
	if (!pdata)
		return -ENOMEM;

	msm_set_codec_reg_done(false);
	match = of_match_node(sdm660_asoc_machine_of_match,
			      pdev->dev.of_node);
	if (!match)
+1 −0
Original line number Diff line number Diff line
@@ -122,4 +122,5 @@ void msm_aux_pcm_snd_shutdown(struct snd_pcm_substream *substream);
int msm_mi2s_snd_startup(struct snd_pcm_substream *substream);
void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream);
int msm_common_snd_controls_size(void);
void msm_set_codec_reg_done(bool done);
#endif
+2 −6
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@

static int msm_ext_spk_control = 1;
static struct wcd_mbhc_config *wcd_mbhc_cfg_ptr;
bool codec_reg_done;

struct msm_asoc_wcd93xx_codec {
	void* (*get_afe_config_fn)(struct snd_soc_codec *codec,
@@ -1772,7 +1771,6 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
		if (!entry) {
			pr_debug("%s: Cannot create codecs module entry\n",
				 __func__);
			pdata->codec_root = NULL;
			goto done;
		}
		pdata->codec_root = entry;
@@ -1795,18 +1793,16 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
		if (!entry) {
			pr_debug("%s: Cannot create codecs module entry\n",
				 __func__);
			ret = 0;
			goto err_snd_module;
			goto done;
		}
		pdata->codec_root = entry;
		tasha_codec_info_create_codec_entry(pdata->codec_root, codec);
		tasha_mbhc_zdet_gpio_ctrl(msm_config_hph_en0_gpio, rtd->codec);
	}
	codec_reg_done = true;
done:
	msm_set_codec_reg_done(true);
	return 0;

err_snd_module:
err_afe_cfg:
	return ret;
}
+1 −0
Original line number Diff line number Diff line
@@ -1314,6 +1314,7 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
	msm_dig_codec_info_create_codec_entry(codec_root, dig_cdc);
	msm_anlg_codec_info_create_codec_entry(codec_root, ana_cdc);
done:
	msm_set_codec_reg_done(true);
	return 0;
}