Skip to content

Commit e4c6eba

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: Intel: regroup all SoundWire/Intel functions in hda.c
To avoid circular dependencies between SOF/Intel and SoundWire/Intel, we need to split the top-level hda.c from the rest of the code. This patch first regroups all SoundWire related code in hda.c. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9e7fd21 commit e4c6eba

File tree

2 files changed

+39
-40
lines changed

2 files changed

+39
-40
lines changed

sound/soc/sof/intel/hda-loader.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* Hardware interface for HDA DSP code loader
1616
*/
1717

18-
#include <linux/debugfs.h>
1918
#include <linux/firmware.h>
2019
#include <sound/hdaudio_ext.h>
2120
#include <sound/hda_register.h>
@@ -651,45 +650,6 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev,
651650
return ret;
652651
}
653652

654-
/* pre fw run operations */
655-
int hda_dsp_pre_fw_run(struct snd_sof_dev *sdev)
656-
{
657-
/* disable clock gating and power gating */
658-
return hda_dsp_ctrl_clock_power_gating(sdev, false);
659-
}
660-
661-
/* post fw run operations */
662-
int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
663-
{
664-
int ret;
665-
666-
if (sdev->first_boot) {
667-
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
668-
669-
ret = hda_sdw_startup(sdev);
670-
if (ret < 0) {
671-
dev_err(sdev->dev,
672-
"error: could not startup SoundWire links\n");
673-
return ret;
674-
}
675-
676-
/* Check if IMR boot is usable */
677-
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
678-
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
679-
sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) {
680-
hdev->imrboot_supported = true;
681-
debugfs_create_bool("skip_imr_boot",
682-
0644, sdev->debugfs_root,
683-
&hdev->skip_imr_boot);
684-
}
685-
}
686-
687-
hda_sdw_int_enable(sdev, true);
688-
689-
/* re-enable clock gating and power gating */
690-
return hda_dsp_ctrl_clock_power_gating(sdev, true);
691-
}
692-
693653
int hda_dsp_ext_man_get_cavs_config_data(struct snd_sof_dev *sdev,
694654
const struct sof_ext_man_elem_header *hdr)
695655
{

sound/soc/sof/intel/hda.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,45 @@ static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
545545

546546
#endif /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */
547547

548+
/* pre fw run operations */
549+
int hda_dsp_pre_fw_run(struct snd_sof_dev *sdev)
550+
{
551+
/* disable clock gating and power gating */
552+
return hda_dsp_ctrl_clock_power_gating(sdev, false);
553+
}
554+
555+
/* post fw run operations */
556+
int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
557+
{
558+
int ret;
559+
560+
if (sdev->first_boot) {
561+
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
562+
563+
ret = hda_sdw_startup(sdev);
564+
if (ret < 0) {
565+
dev_err(sdev->dev,
566+
"error: could not startup SoundWire links\n");
567+
return ret;
568+
}
569+
570+
/* Check if IMR boot is usable */
571+
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
572+
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
573+
sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) {
574+
hdev->imrboot_supported = true;
575+
debugfs_create_bool("skip_imr_boot",
576+
0644, sdev->debugfs_root,
577+
&hdev->skip_imr_boot);
578+
}
579+
}
580+
581+
hda_sdw_int_enable(sdev, true);
582+
583+
/* re-enable clock gating and power gating */
584+
return hda_dsp_ctrl_clock_power_gating(sdev, true);
585+
}
586+
548587
/*
549588
* Debug
550589
*/

0 commit comments

Comments
 (0)