Skip to content

Commit 7ddb711

Browse files
Shenghao-Dingtiwai
authored andcommitted
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: e83dcd1 ("ASoC: tas2781: Add keyword "init" in profile section") Signed-off-by: Shenghao Ding <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 7a6399e commit 7ddb711

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sound/hda/codecs/side-codecs/tas2781_hda_i2c.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ static void tasdevice_dspfw_init(void *context)
474474
if (tas_priv->fmw->nr_configurations > 0)
475475
tas_priv->cur_conf = 0;
476476

477+
/* Init common setting for different audio profiles */
478+
if (tas_priv->rcabin.init_profile_id >= 0)
479+
tasdevice_select_cfg_blk(tas_priv,
480+
tas_priv->rcabin.init_profile_id,
481+
TASDEVICE_BIN_BLK_PRE_POWER_UP);
482+
477483
/* If calibrated data occurs error, dsp will still works with default
478484
* calibrated data inside algo.
479485
*/
@@ -770,6 +776,12 @@ static int tas2781_system_resume(struct device *dev)
770776
tasdevice_reset(tas_hda->priv);
771777
tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog);
772778

779+
/* Init common setting for different audio profiles */
780+
if (tas_hda->priv->rcabin.init_profile_id >= 0)
781+
tasdevice_select_cfg_blk(tas_hda->priv,
782+
tas_hda->priv->rcabin.init_profile_id,
783+
TASDEVICE_BIN_BLK_PRE_POWER_UP);
784+
773785
if (tas_hda->priv->playback_started)
774786
tasdevice_tuning_switch(tas_hda->priv, 0);
775787

0 commit comments

Comments
 (0)