Skip to content

Commit 3e75531

Browse files
committed
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>
1 parent 9bd8b35 commit 3e75531

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ int hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable)
183183
}
184184
EXPORT_SYMBOL_NS(hda_dsp_ctrl_clock_power_gating, "SND_SOC_SOF_INTEL_HDA_COMMON");
185185

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)
187187
{
188188
struct hdac_bus *bus = sof_to_bus(sdev);
189189
struct hdac_stream *stream;
@@ -223,7 +223,8 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev)
223223
/* Accept unsolicited responses */
224224
snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
225225

226-
hda_codec_detect_mask(sdev);
226+
if (detect_codec)
227+
hda_codec_detect_mask(sdev);
227228

228229
/* clear stream status */
229230
list_for_each_entry(stream, &bus->stream_list, list) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
881881
snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0);
882882

883883
/* reset and start hda controller */
884-
ret = hda_dsp_ctrl_init_chip(sdev);
884+
ret = hda_dsp_ctrl_init_chip(sdev, false);
885885
if (ret < 0) {
886886
dev_err(sdev->dev,
887887
"error: failed to start controller after resume\n");

sound/soc/sof/intel/hda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
616616
dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n");
617617

618618
/* Init HDA controller after i915 init */
619-
ret = hda_dsp_ctrl_init_chip(sdev);
619+
ret = hda_dsp_ctrl_init_chip(sdev, true);
620620
if (ret < 0) {
621621
dev_err(bus->dev, "error: init chip failed with ret: %d\n",
622622
ret);

sound/soc/sof/intel/hda.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ void hda_dsp_ctrl_ppcap_int_enable(struct snd_sof_dev *sdev, bool enable);
757757
int hda_dsp_ctrl_link_reset(struct snd_sof_dev *sdev, bool reset);
758758
void hda_dsp_ctrl_misc_clock_gating(struct snd_sof_dev *sdev, bool enable);
759759
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);
761761
void hda_dsp_ctrl_stop_chip(struct snd_sof_dev *sdev);
762762
/*
763763
* HDA bus operations.

0 commit comments

Comments
 (0)