Skip to content

ASoC: Intel: avs: Soundwire support

Cezary Rojewski linux-sound lkml oe-kbuild-all 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 5 repliesIn review
  2. v27 patches 9 repliesSuperseded
  3. v17 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- sdw_intel_pdi_config() now re-used in the existing code
- wakests now read as u16 rather than u32
- dropped superfluous declaration of sdw_intel_init_pdis()
- avs_sdw_dai_hw_params() now calls sdw_stream_remove_master() when sdw_stream_add_master() fails

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7soundwire: intel: Define stubs when library is disabledinclude/linux/soundwire/sdw_intel.h sound/hda/core/Kconfig sound/hda/core/Makefile+38 -10 replies
2/7soundwire: intel: Allow for dynamic assignment of PDIsdrivers/soundwire/cadence_master.c drivers/soundwire/cadence_master.h drivers/soundwire/intel.c +2 more+128 -271 reply
3/7soundwire: intel: Split PDIs and DAIs initializationdrivers/soundwire/intel.c drivers/soundwire/intel.h drivers/soundwire/intel_ace2x.c +2 more+47 -200 replies
4/7ASoC: Intel: avs: Pass irq to dsp_interrupt callbacksound/soc/intel/avs/apl.c sound/soc/intel/avs/avs.h sound/soc/intel/avs/cnl.c +3 more+8 -80 replies
5/7ASoC: Intel: avs: SoundWire supportsound/soc/intel/Kconfig sound/soc/intel/avs/Makefile sound/soc/intel/avs/avs.h +6 more+230 -20 replies
6/7ASoC: Intel: avs: Expose common PCM functionssound/soc/intel/avs/avs.h sound/soc/intel/avs/pcm.c sound/soc/intel/avs/pcm.h+58 -390 replies
7/7ASoC: Intel: avs: SoundWire PCM BE operationssound/soc/intel/avs/Makefile sound/soc/intel/avs/messages.h sound/soc/intel/avs/path.c +3 more+306 -14 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/7] ASoC: Intel: avs: Soundwire support

The RaptorLake-P and RaptorLake-M based platform used in Automotive area do utilize SoundWire for streaming audio. This patchset brings such support to the public domain.

If possible, I'd like the changes to go through Mark's tree.

As the patchset updates drivers/soundwire, I've decided to strip it off any machine-boards and have here just the changes done to the main soundwire driver and their user/usage. Machine boards for RPL-P/M will follow in a separate set and do not touch drivers/soundwire stuff.

The reasoning behind modyfing the soundwire code:

Typically dai->startup() is responsible for checking if all the required resources are available whereas dai->hw_params() is responsible for configuring such resources. Existing code does the PDI assignment and its configuration within one function - intel_hw_params(). The logical split is not possible. The change provides functions that represent such logical blocks: assign, release and config. Such division exists already for the HDAudio interface, see sound/hda/core/stream.c

For the user i.e.: avs-driver (sound/soc/intel/avs) it also makes the code very cohesive - aligns with that's done on the HDAudio side as all the HDAudio streams are assignment during dai->startup() and configured with dai->hw_params().

Also, the existing code fetches the PDIs based on pre-defined "dai_id". That's not the case for the avs-driver. It simply asks: "is any PDI free?" and assigns it for the substream if one is found.
No predefining. Again, this aligns with how HDAudio streaming is done.

avs-driver -only patches follow the three soundwire ones. First, they extend the existing code so it can accommodate SDW interface. With that done, laverage existing PCM code (sound/soc/intel/avs/pcm.c) and soundwire-intel to implement DAI operations.

Changes in v3:
- sdw_intel_pdi_config() now re-used in the existing code
- wakests now read as u16 rather than u32
- dropped superfluous declaration of sdw_intel_init_pdis()
- avs_sdw_dai_hw_params() now calls sdw_stream_remove_master() when sdw_stream_add_master() fails

Changes in v2:
- dropped duplicate headers as pointed by Amadeusz
- fixed PDI initialization for ace2x as pointed by Bard. This is done by introducing ->init_pdis() ops and calling it just before ->register_dais(). The body of the ops is 1:1 with the existing PDI initialization code
- fixed the error path if init_pdis() fails, as pointed by Bard
- fixed Amadeusz' email for all the headers

A number of changes pointed by Sashiko:
- fixed compilation when CONFIG_SND_SOC_INTEL_AVS=y and CONFIG_SOUNDWIRE_INTEL=m. This is done with help of new kconfig:
SND_SOC_INTEL_AVS_SOUNDWIRE
- added missing kernel docs
- avs_sdw_dai_trigger()/prepare() now rollback sdw_stream state if DSP operations fail
- avs_sdw_dai_shutdown() now NULLs the sdw_stream context
- wanted to reserve this for later but since the bot pointed this out, updated hw_params(), hw_free() and prepare() to accommodate for suspend/resume scenario with a SDW stream
- sdw_intel_acpi_scan() now returns -ENODEV if the library is disabled (previously returned 0)
- avs_sdw_probe() now exits early if the link_mask is 0
- disabled SDW probing for avs-driver on ACE2+ platforms

Cezary Rojewski (7):
soundwire: intel: Define stubs when library is disabled
soundwire: intel: Allow for dynamic assignment of PDIs
soundwire: intel: Split PDIs and DAIs initialization
ASoC: Intel: avs: Pass irq to dsp_interrupt callback
ASoC: Intel: avs: SoundWire support
ASoC: Intel: avs: Expose common PCM functions
ASoC: Intel: avs: SoundWire PCM BE operations

 drivers/soundwire/cadence_master.c    |  64 ++++++
 drivers/soundwire/cadence_master.h    |  25 +--
 drivers/soundwire/intel.c             |  49 +++--
 drivers/soundwire/intel.h             |   9 +-
 drivers/soundwire/intel_ace2x.c       |  25 ++-
 drivers/soundwire/intel_auxdevice.c   |   4 +
 include/linux/soundwire/sdw_cadence.h |  35 ++++
 include/linux/soundwire/sdw_intel.h   |  45 +++-
 sound/hda/core/Kconfig                |   2 +-
 sound/hda/core/Makefile               |   3 +
 sound/soc/intel/Kconfig               |   8 +
 sound/soc/intel/avs/Makefile          |   4 +
 sound/soc/intel/avs/apl.c             |   2 +-
 sound/soc/intel/avs/avs.h             |  15 +-
 sound/soc/intel/avs/cnl.c             |  25 ++-
 sound/soc/intel/avs/core.c            |  23 +-
 sound/soc/intel/avs/loader.c          |   3 +
 sound/soc/intel/avs/messages.h        |   2 +
 sound/soc/intel/avs/mtl.c             |   2 +-
 sound/soc/intel/avs/path.c            |   2 +
 sound/soc/intel/avs/pcm.c             |  42 +---
 sound/soc/intel/avs/pcm.h             |  50 +++++
 sound/soc/intel/avs/pcm_sdw.c         | 291 ++++++++++++++++++++++++++
 sound/soc/intel/avs/registers.h       |   4 +
 sound/soc/intel/avs/skl.c             |   2 +-
 sound/soc/intel/avs/soundwire.c       | 112 ++++++++++
 sound/soc/intel/avs/soundwire.h       |  63 ++++++
 27 files changed, 814 insertions(+), 97 deletions(-)
 create mode 100644 include/linux/soundwire/sdw_cadence.h
 create mode 100644 sound/soc/intel/avs/pcm_sdw.c
 create mode 100644 sound/soc/intel/avs/soundwire.c
 create mode 100644 sound/soc/intel/avs/soundwire.h
Signature · 1 line
2.34.1