Skip to content

ASoC: sdw_utils: Add quirk for disabling capture ch - #5958

Open
niranjanhyti wants to merge 1 commit into
thesofproject:topic/sof-devfrom
niranjanhyti:spk-ref-stream
Open

niranjanhyti wants to merge 1 commit into
thesofproject:topic/sof-devfrom
niranjanhyti:spk-ref-stream

Conversation

@niranjanhyti

Copy link
Copy Markdown

Amps can provide reference stream to hosts DSP which can be used for input audio proocessing. But some AMD HW doesn't
support such a feature and hence reference stream should be selectively disabled for those. This patch adds the following quirk for the same

  • ASOC_SDW_CODEC_EXCLUDE_SPK_REF_STREAM

Suggested-by: Vijendar Mukunda Vijendar.Mukunda@amd.com

@sofci

sofci commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

Amps can provide reference stream to hosts DSP which
can be used for input audio proocessing. But some
AMD HW doesn't support such a feature and hence
reference stream should be selectively disabled for those.

  This patch adds the following quirk for the same.
ASOC_SDW_CODEC_EXCLUDE_SPK_REF_STREAM

Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
Suggested-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

DMI overrides discard the new quirk, while global codec metadata mutation can leak into unrelated card probes.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds an AMD SoundWire quirk to suppress unsupported amplifier reference capture streams.

Changes:

  • Defines the speaker-reference exclusion quirk.
  • Adds a helper to disable amplifier capture directions.
  • Enables the quirk for the AMD legacy machine driver.
File Description
sound/​soc/​sdw_utils/​soc_sdw_utils.c Adds the capture-disable helper.
sound/​soc/​amd/​acp/​acp-sdw-legacy-mach.c Applies the new quirk during probing.
include/​sound/​soc_sdw_utils.h Defines the quirk and exposes mutable directions/helper API.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

#include "../../codecs/rt711.h"

static unsigned long soc_sdw_quirk = RT711_JD1;
static unsigned long soc_sdw_quirk = RT711_JD1 | ASOC_SDW_CODEC_EXCLUDE_SPK_REF_STREAM;;
Comment on lines +2386 to +2387
if (dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP)
dais[j].direction[SNDRV_PCM_STREAM_CAPTURE] = false;
@bardliao

Copy link
Copy Markdown
Collaborator

codec_info_list[] provides the codec information and the machine driver can use the information to create the dai links it needs. IMHO, adding a quirk and set dais[j].direction[SNDRV_PCM_STREAM_CAPTURE] = false; is not the right way to fix the issue. I would suggest adding the link conditionally in create_sdw_dailink().
Something like

diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c
index 6eac42bac855..9a975a3c7b97 100644
--- a/sound/soc/amd/acp/acp-sdw-legacy-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c
@@ -254,6 +254,8 @@ static int create_sdw_dailink(struct snd_soc_card *card,
                list_for_each_entry(soc_end, &soc_dai->endpoints, list) {
                        if (!soc_end->dai_info->direction[stream])
                                continue;
+                       if (dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP && stream == SNDRV_PCM_STREAM_CAPTURE)
+                               continue;

                        int link_num = ffs(soc_end->link_mask) - 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants