linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe
@ 2025-08-29  8:29 Peter Ujfalusi
  2025-08-29  8:29 ` [PATCH 1/2] ASoC: SOF: Intel: split codec mask detect and programming UNSOL Peter Ujfalusi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2025-08-29  8:29 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart

Hi,

SDW codecs use the global HDaudio WAKEEN/STS to detect wakes since LNL. But 
the wakeen is handled in the SDW driver. We should filter the bus->codec_mask
to only include HDA and IDISP codecs to avoid clearing the wakeen status
before it is handled.

Regards,
Peter
---
Bard Liao (2):
  ASoC: SOF: Intel: split codec mask detect and programming UNSOL
  ASoC: SOF: Intel: only detect codecs when HDA DSP probe

 sound/soc/sof/intel/hda-codec.c | 3 ---
 sound/soc/sof/intel/hda-ctrl.c  | 8 ++++++--
 sound/soc/sof/intel/hda-dsp.c   | 2 +-
 sound/soc/sof/intel/hda.c       | 2 +-
 sound/soc/sof/intel/hda.h       | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ASoC: SOF: Intel: split codec mask detect and programming UNSOL
  2025-08-29  8:29 [PATCH 0/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
@ 2025-08-29  8:29 ` Peter Ujfalusi
  2025-08-29  8:29 ` [PATCH 2/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
  2025-08-30 10:32 ` [PATCH 0/2] " Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2025-08-29  8:29 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart

From: Bard Liao <yung-chuan.liao@linux.intel.com>

We only need to detect codec mask in probe, but need to program UNSOL
in probe and resume. We will detect codec mask and program UNSOL
separately in the follow up commit.

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>
---
 sound/soc/sof/intel/hda-codec.c | 3 ---
 sound/soc/sof/intel/hda-ctrl.c  | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 2f9925830d1d..37674ea452d6 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -260,9 +260,6 @@ void hda_codec_detect_mask(struct snd_sof_dev *sdev)
 	    sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
 		return;
 
-	/* Accept unsolicited responses */
-	snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
-
 	/* detect codecs */
 	if (!bus->codec_mask) {
 		bus->codec_mask = snd_hdac_chip_readw(bus, STATESTS);
diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c
index 4f34fd919a00..f43eb2a21f48 100644
--- a/sound/soc/sof/intel/hda-ctrl.c
+++ b/sound/soc/sof/intel/hda-ctrl.c
@@ -220,6 +220,9 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev)
 	}
 	usleep_range(1000, 1200);
 
+	/* Accept unsolicited responses */
+	snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
+
 	hda_codec_detect_mask(sdev);
 
 	/* clear stream status */
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe
  2025-08-29  8:29 [PATCH 0/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
  2025-08-29  8:29 ` [PATCH 1/2] ASoC: SOF: Intel: split codec mask detect and programming UNSOL Peter Ujfalusi
@ 2025-08-29  8:29 ` Peter Ujfalusi
  2025-08-30 10:32 ` [PATCH 0/2] " Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2025-08-29  8:29 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart

From: Bard Liao <yung-chuan.liao@linux.intel.com>

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>
---
 sound/soc/sof/intel/hda-ctrl.c | 5 +++--
 sound/soc/sof/intel/hda-dsp.c  | 2 +-
 sound/soc/sof/intel/hda.c      | 2 +-
 sound/soc/sof/intel/hda.h      | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c
index f43eb2a21f48..8332d4bda558 100644
--- a/sound/soc/sof/intel/hda-ctrl.c
+++ b/sound/soc/sof/intel/hda-ctrl.c
@@ -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) {
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index f64e8a6a9a33..3ab6d5ce6329 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -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");
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index c387efec41e9..52e86fa60077 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -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);
diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h
index e14f82c0831f..28daf0a3b984 100644
--- a/sound/soc/sof/intel/hda.h
+++ b/sound/soc/sof/intel/hda.h
@@ -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.
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe
  2025-08-29  8:29 [PATCH 0/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
  2025-08-29  8:29 ` [PATCH 1/2] ASoC: SOF: Intel: split codec mask detect and programming UNSOL Peter Ujfalusi
  2025-08-29  8:29 ` [PATCH 2/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
@ 2025-08-30 10:32 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-08-30 10:32 UTC (permalink / raw)
  To: lgirdwood, Peter Ujfalusi
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart

On Fri, 29 Aug 2025 11:29:06 +0300, Peter Ujfalusi wrote:
> SDW codecs use the global HDaudio WAKEEN/STS to detect wakes since LNL. But
> the wakeen is handled in the SDW driver. We should filter the bus->codec_mask
> to only include HDA and IDISP codecs to avoid clearing the wakeen status
> before it is handled.
> 
> Regards,
> Peter
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: SOF: Intel: split codec mask detect and programming UNSOL
      commit: 6158a321c051095024e8306c8996b79e5f7f79b6
[2/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe
      commit: 5c39bc498f5ff7ef016abf3f16698f3e8db79677

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-30 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29  8:29 [PATCH 0/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
2025-08-29  8:29 ` [PATCH 1/2] ASoC: SOF: Intel: split codec mask detect and programming UNSOL Peter Ujfalusi
2025-08-29  8:29 ` [PATCH 2/2] ASoC: SOF: Intel: only detect codecs when HDA DSP probe Peter Ujfalusi
2025-08-30 10:32 ` [PATCH 0/2] " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).