]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: SOF: Intel: start SoundWire links earlier for LNL+ devices
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 13 Feb 2024 10:12:42 +0000 (12:12 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 13 Feb 2024 13:28:59 +0000 (13:28 +0000)
The SoundWire integration is different from previous platforms, with
no dependencies on the DSP enablement. We can start the SoundWire
links in the probe instead of waiting for the post_fw_run stage.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/20240213101247.28887-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-dsp.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/lnl.c

index 2445ae7f6b2e924fa0f192b2322dbd77eeee1b29..31ffa1a8f2ac04ddd5c31aadec5400c52757dd19 100644 (file)
@@ -748,6 +748,7 @@ skip_dsp:
 
 static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
 {
+       const struct sof_intel_dsp_desc *chip;
        int ret;
 
        /* display codec must be powered before link reset */
@@ -780,6 +781,10 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
                hda_dsp_ctrl_ppcap_int_enable(sdev, true);
        }
 
+       chip = get_chip_info(sdev->pdata);
+       if (chip && chip->hw_ip_version >= SOF_INTEL_ACE_2_0)
+               hda_sdw_int_enable(sdev, true);
+
 cleanup:
        /* display codec can powered off after controller init */
        hda_codec_i915_display_power(sdev, false);
index 0bae439feb8bf03f83c8daa7616c0ec6575b010b..7fe72b06545147aee2bde593de7c7a5129de4a10 100644 (file)
@@ -1231,6 +1231,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
 {
        struct pci_dev *pci = to_pci_dev(sdev->dev);
        struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
+       const struct sof_intel_dsp_desc *chip;
        int ret = 0;
 
        hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec",
@@ -1344,12 +1345,28 @@ skip_dsp_setup:
                INIT_DELAYED_WORK(&hdev->d0i3_work, hda_dsp_d0i3_work);
        }
 
+       chip = get_chip_info(sdev->pdata);
+       if (chip && chip->hw_ip_version >= SOF_INTEL_ACE_2_0) {
+               ret = hda_sdw_startup(sdev);
+               if (ret < 0) {
+                       dev_err(sdev->dev, "could not startup SoundWire links\n");
+                       goto disable_pp_cap;
+               }
+
+               hda_sdw_int_enable(sdev, true);
+       }
+
        init_waitqueue_head(&hdev->waitq);
 
        hdev->nhlt = intel_nhlt_init(sdev->dev);
 
        return 0;
 
+disable_pp_cap:
+       if (!sdev->dspless_mode_selected) {
+               hda_dsp_ctrl_ppcap_int_enable(sdev, false);
+               hda_dsp_ctrl_ppcap_enable(sdev, false);
+       }
 free_ipc_irq:
        free_irq(sdev->ipc_irq, sdev);
 free_irq_vector:
index 30712ea05a7a54086c798aa9e737cf0f7283ebbb..b2ade2741dce6936c82e3d0d42850e1faefb90c2 100644 (file)
@@ -77,6 +77,19 @@ static int lnl_hda_dsp_runtime_resume(struct snd_sof_dev *sdev)
        return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
 }
 
+static int lnl_dsp_post_fw_run(struct snd_sof_dev *sdev)
+{
+       if (sdev->first_boot) {
+               struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
+
+               /* Check if IMR boot is usable */
+               if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT))
+                       hda->imrboot_supported = true;
+       }
+
+       return 0;
+}
+
 int sof_lnl_ops_init(struct snd_sof_dev *sdev)
 {
        struct sof_ipc4_fw_data *ipc4_data;
@@ -106,7 +119,7 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev)
 
        /* pre/post fw run */
        sof_lnl_ops.pre_fw_run = mtl_dsp_pre_fw_run;
-       sof_lnl_ops.post_fw_run = mtl_dsp_post_fw_run;
+       sof_lnl_ops.post_fw_run = lnl_dsp_post_fw_run;
 
        /* parse platform specific extended manifest */
        sof_lnl_ops.parse_platform_ext_manifest = NULL;