Commit 7ddb711b authored by Shenghao Ding's avatar Shenghao Ding Committed by Takashi Iwai
Browse files

ALSA: hda/tas2781: Enable init_profile_id for device initialization



Optimize the time consumption of profile switching, init_profile saves
the common settings of different profiles, such as the dsp coefficients,
etc, which can greatly reduce the profile switching time comsumption and
remove the repetitive settings.

Fixes: e83dcd13 ("ASoC: tas2781: Add keyword "init" in profile section")
Signed-off-by: default avatarShenghao Ding <shenghao-ding@ti.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 7a6399e3
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -474,6 +474,12 @@ static void tasdevice_dspfw_init(void *context)
	if (tas_priv->fmw->nr_configurations > 0)
		tas_priv->cur_conf = 0;

	/* Init common setting for different audio profiles */
	if (tas_priv->rcabin.init_profile_id >= 0)
		tasdevice_select_cfg_blk(tas_priv,
			tas_priv->rcabin.init_profile_id,
			TASDEVICE_BIN_BLK_PRE_POWER_UP);

	/* If calibrated data occurs error, dsp will still works with default
	 * calibrated data inside algo.
	 */
@@ -770,6 +776,12 @@ static int tas2781_system_resume(struct device *dev)
	tasdevice_reset(tas_hda->priv);
	tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog);

	/* Init common setting for different audio profiles */
	if (tas_hda->priv->rcabin.init_profile_id >= 0)
		tasdevice_select_cfg_blk(tas_hda->priv,
			tas_hda->priv->rcabin.init_profile_id,
			TASDEVICE_BIN_BLK_PRE_POWER_UP);

	if (tas_hda->priv->playback_started)
		tasdevice_tuning_switch(tas_hda->priv, 0);