Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: Intel: only detect codecs when HDA DSP probe

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>

authored by

Bard Liao and committed by
Mark Brown
5c39bc49 6158a321

+6 -5
+3 -2
sound/soc/sof/intel/hda-ctrl.c
··· 183 183 } 184 184 EXPORT_SYMBOL_NS(hda_dsp_ctrl_clock_power_gating, "SND_SOC_SOF_INTEL_HDA_COMMON"); 185 185 186 - int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev) 186 + int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool detect_codec) 187 187 { 188 188 struct hdac_bus *bus = sof_to_bus(sdev); 189 189 struct hdac_stream *stream; ··· 223 223 /* Accept unsolicited responses */ 224 224 snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL); 225 225 226 - hda_codec_detect_mask(sdev); 226 + if (detect_codec) 227 + hda_codec_detect_mask(sdev); 227 228 228 229 /* clear stream status */ 229 230 list_for_each_entry(stream, &bus->stream_list, list) {
+1 -1
sound/soc/sof/intel/hda-dsp.c
··· 870 870 snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0); 871 871 872 872 /* reset and start hda controller */ 873 - ret = hda_dsp_ctrl_init_chip(sdev); 873 + ret = hda_dsp_ctrl_init_chip(sdev, false); 874 874 if (ret < 0) { 875 875 dev_err(sdev->dev, 876 876 "error: failed to start controller after resume\n");
+1 -1
sound/soc/sof/intel/hda.c
··· 616 616 dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n"); 617 617 618 618 /* Init HDA controller after i915 init */ 619 - ret = hda_dsp_ctrl_init_chip(sdev); 619 + ret = hda_dsp_ctrl_init_chip(sdev, true); 620 620 if (ret < 0) { 621 621 dev_err(bus->dev, "error: init chip failed with ret: %d\n", 622 622 ret);
+1 -1
sound/soc/sof/intel/hda.h
··· 757 757 int hda_dsp_ctrl_link_reset(struct snd_sof_dev *sdev, bool reset); 758 758 void hda_dsp_ctrl_misc_clock_gating(struct snd_sof_dev *sdev, bool enable); 759 759 int hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable); 760 - int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev); 760 + int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool detect_codec); 761 761 void hda_dsp_ctrl_stop_chip(struct snd_sof_dev *sdev); 762 762 /* 763 763 * HDA bus operations.