Skip to content

ASoC/soundwire: Intel: reset the PCMSyCM registers in hda_sdw_bpt_close#5715

Open
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:reset-PCMSyCM
Open

ASoC/soundwire: Intel: reset the PCMSyCM registers in hda_sdw_bpt_close#5715
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:reset-PCMSyCM

Conversation

@bardliao
Copy link
Copy Markdown
Collaborator

@bardliao bardliao commented Apr 1, 2026

Resetting the PCMSyCM registers is required for Intel SoundWire stream. The same procedure is done in sdw_hda_dai_hw_params() for the normal SoundWire stream, too.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures Intel SoundWire BPT cleanup resets the PCMSyCM registers on stream close, matching the reset behavior already present for “normal” SoundWire streams.

Changes:

  • Extend hda_sdw_bpt_close() API to accept a link_id.
  • Reset PCMSyCM registers for TX/RX PDIs in hda_sdw_bpt_close().
  • Update in-tree callers to pass the SoundWire instance/link identifier.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
sound/soc/sof/intel/hda-sdw-bpt.c Adds PCMSyCM reset in close path and threads link_id into the close call.
include/sound/hda-sdw-bpt.h Updates the exported/stub prototype for hda_sdw_bpt_close() with link_id.
drivers/soundwire/intel_ace2x.c Updates callers to pass sdw->instance as the link_id argument.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +463 to +470
if (ret)
dev_err(dev, "%s: PCMSyCM PCMSyCM failed for TX: %d\n",
__func__, ret);

ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* cpu_dai->id -> PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret)
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The return value from hdac_bus_eml_sdw_map_stream_ch() is checked with if (ret) here, but the rest of this file (and e.g. sound/soc/sof/intel/hda-dai.c) consistently treats errors as ret < 0. Please switch to ret < 0 to avoid flagging any non-negative return as an error and to keep error handling consistent.

Suggested change
if (ret)
dev_err(dev, "%s: PCMSyCM PCMSyCM failed for TX: %d\n",
__func__, ret);
ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* cpu_dai->id -> PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret)
if (ret < 0)
dev_err(dev, "%s: PCMSyCM PCMSyCM failed for TX: %d\n",
__func__, ret);
ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* cpu_dai->id -> PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret < 0)

Copilot uses AI. Check for mistakes.
Resetting the PCMSyCM registers is required for Intel SoundWire stream. The
same procedure is done in sdw_hda_dai_hw_params() for the normal
SoundWire stream, too.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
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.

2 participants