]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: SOF: Intel: only detect codecs when HDA DSP probe
authorBard Liao <yung-chuan.liao@linux.intel.com>
Fri, 29 Aug 2025 08:29:08 +0000 (11:29 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 29 Aug 2025 08:50:37 +0000 (10:50 +0200)
SDW codecs use the global HDaudio WAKEEN/STS to detect wakes since LNL.
But the wake event is handled in the SDW driver. We should only clear
WAKESTS for the HDA and IDISP codecs that was detected when HDA DSP
probe. The SoundWire codec will be included in the codec_mask if we read
the STATESTS register when a SoundWire codec wake event happens.
The commit avoid updating bus->codec_mask in resume to not clear WAKESTS
of SoundWire codecs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Message-ID: <20250829082908.2693-3-peter.ujfalusi@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-ctrl.c
sound/soc/sof/intel/hda-dsp.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/hda.h

index f43eb2a21f48da930e365c5777b9bc78abe13003..8332d4bda5581fbd35229b1097d57d4f6e0e8358 100644 (file)
@@ -183,7 +183,7 @@ int hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable)
 }
 EXPORT_SYMBOL_NS(hda_dsp_ctrl_clock_power_gating, "SND_SOC_SOF_INTEL_HDA_COMMON");
 
-int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev)
+int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool detect_codec)
 {
        struct hdac_bus *bus = sof_to_bus(sdev);
        struct hdac_stream *stream;
@@ -223,7 +223,8 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev)
        /* Accept unsolicited responses */
        snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
 
-       hda_codec_detect_mask(sdev);
+       if (detect_codec)
+               hda_codec_detect_mask(sdev);
 
        /* clear stream status */
        list_for_each_entry(stream, &bus->stream_list, list) {
index f64e8a6a9a33c258b01975f8db345d70c7da0e40..3ab6d5ce63298f96bf4f23a367891cb17e27721a 100644 (file)
@@ -870,7 +870,7 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
        snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0);
 
        /* reset and start hda controller */
-       ret = hda_dsp_ctrl_init_chip(sdev);
+       ret = hda_dsp_ctrl_init_chip(sdev, false);
        if (ret < 0) {
                dev_err(sdev->dev,
                        "error: failed to start controller after resume\n");
index c387efec41e93f2c957141ffbfae9dab785b64be..52e86fa6007788961670c4ba47cd57e66d7e8a89 100644 (file)
@@ -616,7 +616,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
                dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n");
 
        /* Init HDA controller after i915 init */
-       ret = hda_dsp_ctrl_init_chip(sdev);
+       ret = hda_dsp_ctrl_init_chip(sdev, true);
        if (ret < 0) {
                dev_err(bus->dev, "error: init chip failed with ret: %d\n",
                        ret);
index e14f82c0831fadff54dd317ef742e919603551ec..28daf0a3b98484ef2f0df34f90384bfd61be99ca 100644 (file)
@@ -757,7 +757,7 @@ void hda_dsp_ctrl_ppcap_int_enable(struct snd_sof_dev *sdev, bool enable);
 int hda_dsp_ctrl_link_reset(struct snd_sof_dev *sdev, bool reset);
 void hda_dsp_ctrl_misc_clock_gating(struct snd_sof_dev *sdev, bool enable);
 int hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable);
-int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev);
+int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool detect_codec);
 void hda_dsp_ctrl_stop_chip(struct snd_sof_dev *sdev);
 /*
  * HDA bus operations.