Skip to content

Commit 8c845ed

Browse files
Shenghao-Dinggregkh
authored andcommitted
ALSA: hda/tas2781: Enable init_profile_id for device initialization
commit 7ddb711b6e0d33e0a673b49f69dff0d950ed60b9 upstream. 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: e83dcd139e77 ("ASoC: tas2781: Add keyword "init" in profile section") Signed-off-by: Shenghao Ding <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 365184e commit 8c845ed

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

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

475+
/* Init common setting for different audio profiles */
476+
if (tas_priv->rcabin.init_profile_id >= 0)
477+
tasdevice_select_cfg_blk(tas_priv,
478+
tas_priv->rcabin.init_profile_id,
479+
TASDEVICE_BIN_BLK_PRE_POWER_UP);
480+
475481
/* If calibrated data occurs error, dsp will still works with default
476482
* calibrated data inside algo.
477483
*/
@@ -760,6 +766,12 @@ static int tas2781_system_resume(struct device *dev)
760766
tasdevice_reset(tas_hda->priv);
761767
tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog);
762768

769+
/* Init common setting for different audio profiles */
770+
if (tas_hda->priv->rcabin.init_profile_id >= 0)
771+
tasdevice_select_cfg_blk(tas_hda->priv,
772+
tas_hda->priv->rcabin.init_profile_id,
773+
TASDEVICE_BIN_BLK_PRE_POWER_UP);
774+
763775
if (tas_hda->priv->playback_started)
764776
tasdevice_tuning_switch(tas_hda->priv, 0);
765777

0 commit comments

Comments
 (0)