summaryrefslogtreecommitdiff
path: root/sound/soc/intel/avs/loader.c
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2022-10-27 15:47:02 +0300
committerMark Brown <broonie@kernel.org>2022-10-28 15:04:39 +0300
commit758ba92f3a2f86493a9147abd31a5bdc0befc273 (patch)
tree4fd3a0106e21acdf99bae888797e9ddc4350ddfc /sound/soc/intel/avs/loader.c
parent2a87f17775c1cbcfb99225312e8cc7a06aa109b9 (diff)
downloadlinux-758ba92f3a2f86493a9147abd31a5bdc0befc273.tar.xz
ASoC: Intel: avs: Enact power gating policy
Update all firmware loading functions to also account for the power gating policy. As module loading routine is missing the chicken bits manipulation entirely, add the entire set there. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/avs/loader.c')
-rw-r--r--sound/soc/intel/avs/loader.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/intel/avs/loader.c b/sound/soc/intel/avs/loader.c
index eb10e45790e7..56bb0a59249d 100644
--- a/sound/soc/intel/avs/loader.c
+++ b/sound/soc/intel/avs/loader.c
@@ -224,11 +224,19 @@ static int avs_cldma_load_module(struct avs_dev *adev, struct avs_module_entry *
if (ret < 0)
return ret;
+ avs_hda_power_gating_enable(adev, false);
+ avs_hda_clock_gating_enable(adev, false);
+ avs_hda_l1sen_enable(adev, false);
+
hda_cldma_set_data(cl, (void *)mod->data, mod->size);
hda_cldma_transfer(cl, msecs_to_jiffies(AVS_CLDMA_START_DELAY_MS));
ret = avs_ipc_load_modules(adev, &mentry->module_id, 1);
hda_cldma_stop(cl);
+ avs_hda_l1sen_enable(adev, true);
+ avs_hda_clock_gating_enable(adev, true);
+ avs_hda_power_gating_enable(adev, true);
+
if (ret) {
dev_err(adev->dev, "load module %d failed: %d\n", mentry->module_id, ret);
avs_release_last_firmware(adev);
@@ -605,6 +613,7 @@ int avs_dsp_boot_firmware(struct avs_dev *adev, bool purge)
for (i = 1; i < adev->fw_cfg.max_libs_count; i++)
memset(adev->lib_names[i], 0, AVS_LIB_NAME_SIZE);
+ avs_hda_power_gating_enable(adev, false);
avs_hda_clock_gating_enable(adev, false);
avs_hda_l1sen_enable(adev, false);
@@ -625,6 +634,7 @@ int avs_dsp_boot_firmware(struct avs_dev *adev, bool purge)
reenable_gating:
avs_hda_l1sen_enable(adev, true);
avs_hda_clock_gating_enable(adev, true);
+ avs_hda_power_gating_enable(adev, true);
if (ret < 0)
return ret;