Skip to content

Commit

Permalink
ASoC: SOF: Intel: hda: Move the IMR boot support check to pre_fw_run
Browse files Browse the repository at this point in the history
While on first boot we obviously not going to do an IMR boot as we have
not booted the DSP up yet, but the flag can be evaluated earlier to allow
new features to rely on the IMR support flag.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
  • Loading branch information
ujfalusi committed Sep 18, 2024
1 parent c4f453b commit 8e8489f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,20 @@ static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
/* pre fw run operations */
int hda_dsp_pre_fw_run(struct snd_sof_dev *sdev)
{
if (sdev->first_boot) {
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;

/* Check if IMR boot is usable */
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) {
hdev->imrboot_supported = true;
debugfs_create_bool("skip_imr_boot",
0644, sdev->debugfs_root,
&hdev->skip_imr_boot);
}
}

/* disable clock gating and power gating */
return hda_dsp_ctrl_clock_power_gating(sdev, false);
}
Expand All @@ -393,24 +407,12 @@ int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
int ret;

if (sdev->first_boot) {
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;

ret = hda_sdw_startup(sdev);
if (ret < 0) {
dev_err(sdev->dev,
"error: could not startup SoundWire links\n");
return ret;
}

/* Check if IMR boot is usable */
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) {
hdev->imrboot_supported = true;
debugfs_create_bool("skip_imr_boot",
0644, sdev->debugfs_root,
&hdev->skip_imr_boot);
}
}

hda_sdw_int_enable(sdev, true);
Expand Down

0 comments on commit 8e8489f

Please sign in to comment.