Skip to content

Commit 988798a

Browse files
committed
ASoC: SOF: Intel: hda: Fold mlink enumeration into hda_dsp_ctrl_init_chip()
Move the hda_bus_ml_init() call from hda_init_caps() into hda_dsp_ctrl_init_chip(), right after the HDA controller reset has been de-asserted and unsolicited responses have been accepted. hda_dsp_ctrl_init_chip() already calls hda_bus_ml_reset_losidv() at the end of its sequence to clear the stream-to-link mapping. On first boot this call was a no-op because the multi-link list had not yet been populated: hda_bus_ml_init() only runs later in hda_init_caps(). Enumerating the links inside init_chip() makes the LOSIDV reset effective on first boot as well, without adding a second reset call from the probe path. hda_bus_ml_init() now returns early when the hlink_list is already populated, so the subsequent invocations from the D3 resume path (hda_resume() -> hda_dsp_ctrl_init_chip(false)) are no-ops. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent fcbe9f1 commit 988798a

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,14 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool detect_codec)
223223
/* Accept unsolicited responses */
224224
snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
225225

226+
/* Perform a one-time enumeration of the Multi-Link capability */
227+
ret = hda_bus_ml_init(bus);
228+
if (ret < 0) {
229+
dev_err(sdev->dev, "%s: failed to enumerate multi-links\n",
230+
__func__);
231+
goto err;
232+
}
233+
226234
if (detect_codec)
227235
hda_codec_detect_mask(sdev);
228236

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ int hda_bus_ml_init(struct hdac_bus *bus)
432432
if (!bus->mlcap)
433433
return 0;
434434

435+
/* Enumeration is a one time operation, skip if already done */
436+
if (!list_empty(&bus->hlink_list))
437+
return 0;
438+
435439
link_count = readl(bus->mlcap + AZX_REG_ML_MLCD) + 1;
436440

437441
dev_dbg(bus->dev, "HDAudio Multi-Link count: %d\n", link_count);

sound/soc/sof/intel/hda.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
625625
return ret;
626626
}
627627

628-
hda_bus_ml_init(bus);
629-
630628
/* Skip SoundWire if it is not supported */
631629
if (!(interface_mask & BIT(SOF_DAI_INTEL_ALH)))
632630
goto skip_soundwire;

0 commit comments

Comments
 (0)