mbox series

[00/21] ASoC: SOF: Intel: HDA: refactor codec and multi-link suport

Message ID 20221027193540.259520-1-pierre-louis.bossart@linux.intel.com (mailing list archive)
Headers show
Series ASoC: SOF: Intel: HDA: refactor codec and multi-link suport | expand

Message

Pierre-Louis Bossart Oct. 27, 2022, 7:35 p.m. UTC
Existing HDaudio controllers expose an HDAudio DMA which is used to
interface with HDaudio codecs. All other interfaces supported by Intel
(SoundWire, SSP, DMIC) rely for data transfers on another GP-DMA
managed by the DSP firmware - the HDaudio DMA is only used for
memory-to-DSP transfers.

New HDaudio extensions will enable the use of this HDaudio DMA for all
of SoundWire, SSP, DMIC. These extensions will be backwards-compatible
for HDaudio and iDISP codecs, but will require new programming
sequences and DAI callbacks for SoundWire, SSP and DMIC.

Before we add support for 'extended audio links' and the programming
sequences for the DMA, we need to refactor the code. All HDaudio codec
support needs to be well identified in a separate file, and likewise
all the 'multi-link' handling needs to be better split.

This patchset removes a number of 'old' Kconfig dependencies and
options, adds helpers with a fallback to remove IS_ENABLED checks in
the code and tries to simplify programming sequences when possible.

One indirect benefit from this refactoring is that developers can
switch with a kernel parameter from HDaudio support to a variant of
'nocodec' support. This proves extremely useful to test on existing
Intel RVPs and Up boards, where the same build can be used to check 3
interfaces (HDaudio, SSP, DMIC) by just removing modules, setting the
kernel parameter and reloading modules.

Pierre-Louis Bossart (21):
  ASoC: SOF: Intel: remove option to disable the common_hdmi handling
  ASoC: SOF: Intel: remove all dependencies on SND_SOC_HDAC_HDMI
  ASoC: SOF: Intel: hda-codec: simplify SND_SOC_SOF_HDA_AUDIO_CODEC
    handling
  ASoC: SOF: Intel: move codec state change to hda-codec.c
  ASoC: SOF: Intel: start moving multi-link handling in dedicated file
  ASoC: SOF: Intel: hda: add multi-link helper for LOSVID
  ASoC: SOF: Intel: move all RIRB/CMD_IO helpers to hda-codec.c
  ASoC: SOF: Intel: hda-ctrl: add codec wakeup helper
  ASoC: SOF: Intel: hda-codec: add hda_codec_device_remove() helper
  ASoC: SOF: Intel: hda-codec: add stop_cmd_io helper
  ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer
  ASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper
  ASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status
  ASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA
  ASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io
  ASoC: SOF: Intel: clarify bus_init and bus_exit sequences
  ASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links
  ASoC: SOF: Intel: add hda_bus_ml_free helper
  ASoC: SOF: Intel: hda: clarify Kconfig dependencies
  ASoC: SOF: Intel: hda-codec: use GPL-2.0-only license
  ASoC: SOF: introduce new DEBUG_NOCODEC mode

 sound/soc/sof/Kconfig            |  18 ++-
 sound/soc/sof/intel/Kconfig      |   2 +-
 sound/soc/sof/intel/Makefile     |   2 +-
 sound/soc/sof/intel/hda-bus.c    |  23 ++-
 sound/soc/sof/intel/hda-codec.c  | 252 +++++++++++++++++++++++++------
 sound/soc/sof/intel/hda-ctrl.c   |  63 ++------
 sound/soc/sof/intel/hda-dai.c    |  10 +-
 sound/soc/sof/intel/hda-dsp.c    |  44 ++----
 sound/soc/sof/intel/hda-mlink.c  |  89 +++++++++++
 sound/soc/sof/intel/hda-stream.c |  30 +---
 sound/soc/sof/intel/hda.c        |  62 ++------
 sound/soc/sof/intel/hda.h        |  63 ++++++--
 sound/soc/sof/sof-audio.c        |   5 +
 sound/soc/sof/sof-priv.h         |   3 +
 14 files changed, 438 insertions(+), 228 deletions(-)
 create mode 100644 sound/soc/sof/intel/hda-mlink.c

Comments

Mark Brown Oct. 28, 2022, 6:52 p.m. UTC | #1
On Thu, 27 Oct 2022 15:35:19 -0400, Pierre-Louis Bossart wrote:
> Existing HDaudio controllers expose an HDAudio DMA which is used to
> interface with HDaudio codecs. All other interfaces supported by Intel
> (SoundWire, SSP, DMIC) rely for data transfers on another GP-DMA
> managed by the DSP firmware - the HDaudio DMA is only used for
> memory-to-DSP transfers.
> 
> New HDaudio extensions will enable the use of this HDaudio DMA for all
> of SoundWire, SSP, DMIC. These extensions will be backwards-compatible
> for HDaudio and iDISP codecs, but will require new programming
> sequences and DAI callbacks for SoundWire, SSP and DMIC.
> 
> [...]

Applied to

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

Thanks!

[01/21] ASoC: SOF: Intel: remove option to disable the common_hdmi handling
        commit: 834c69d3b849625d5c5bb81a3425fc8deef5f16d
[02/21] ASoC: SOF: Intel: remove all dependencies on SND_SOC_HDAC_HDMI
        commit: 2c6c809cc00b71b3195d76a69d603cc761716ab7
[03/21] ASoC: SOF: Intel: hda-codec: simplify SND_SOC_SOF_HDA_AUDIO_CODEC handling
        commit: dc1d964a44dd9eb236f4e98b7b1eaa776093ca8b
[04/21] ASoC: SOF: Intel: move codec state change to hda-codec.c
        commit: 580803a70332f6858245498aaf32f59011d8715b
[05/21] ASoC: SOF: Intel: start moving multi-link handling in dedicated file
        commit: 52f1610370e3a283adc7bf2b39311be7865f671c
[06/21] ASoC: SOF: Intel: hda: add multi-link helper for LOSVID
        commit: 1a7d06ae5dfbaa3dcd801826933531602754338f
[07/21] ASoC: SOF: Intel: move all RIRB/CMD_IO helpers to hda-codec.c
        commit: ad09e4465844547c5046e66025b5a468345a96a5
[08/21] ASoC: SOF: Intel: hda-ctrl: add codec wakeup helper
        commit: 3246a6c9f09eb244c1f9111a288ab010df2be6de
[09/21] ASoC: SOF: Intel: hda-codec: add hda_codec_device_remove() helper
        commit: d4bfba1e754678c51602898ea71570cf6b7cd284
[10/21] ASoC: SOF: Intel: hda-codec: add stop_cmd_io helper
        commit: bf2d764b84abfd880eee50d6982dade9224d1734
[11/21] ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer
        commit: 8da5bceb8c4a8d5c06807b32cea94b278e925d22
[12/21] ASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper
        commit: 87f4230047fc1960377875ff1f1b8f60f736f698
[13/21] ASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status
        commit: 5079aa924fadb9fd811d1a465f034681fe1d074c
[14/21] ASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA
        commit: d191009f77d8ef53d3b75959a4d7db9fcc0ed1d1
[15/21] ASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io
        commit: 3400afcf6800af0be25bf076862dce9a8eac776e
[16/21] ASoC: SOF: Intel: clarify bus_init and bus_exit sequences
        commit: afae09429956b9481d0788385c90238d8d2d038f
[17/21] ASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links
        commit: f402a974aa0ae2b9abcccf49d5ac7c093e86a073
[18/21] ASoC: SOF: Intel: add hda_bus_ml_free helper
        commit: 02785b892c2203c08d49811cc67be2775c4e1f32
[19/21] ASoC: SOF: Intel: hda: clarify Kconfig dependencies
        commit: a4203256e46932e74984c6554d0c502c8994e0b8
[20/21] ASoC: SOF: Intel: hda-codec: use GPL-2.0-only license
        commit: e8b7479d06d565432f87d684d2876d0b0d1f0210
[21/21] ASoC: SOF: introduce new DEBUG_NOCODEC mode
        commit: 4bd1adb85a09c249ddb4610e8412bf0f4484a371

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