mbox series

[0/4] simple-audio-card codec2codec support

Message ID 20200213061147.29386-1-samuel@sholland.org (mailing list archive)
Headers show
Series simple-audio-card codec2codec support | expand

Message

Samuel Holland Feb. 13, 2020, 6:11 a.m. UTC
We are currently using simple-audio-card on the Allwinner A64 SoC.
The digital audio codec there (sun8i-codec) has 3 AIFs, one each for the
CPU, the modem, and Bluetooth. Adding support for the secondary AIFs
requires adding codec2codec DAI links.

Since the modem and bt-sco codec DAI drivers only have one set of
possible PCM parameters (namely, 8kHz mono S16LE), there's no real
need for a machine driver to specify the DAI link configuration. The
parameters for these "simple" DAI links can be chosen automatically.

This series adds a single "codec-to-codec" property to the
simple-audio-card binding, which does exactly what it says. It works out
rather nicely without making the device tree binding too complicated.

The first patch fixes a bug I found while implementing this feature.

I tried to reuse as much code as possible, so the middle two patches
refactor a couple of helper functions to be more generic.

Finally, the last patch adds the new feature and its documentation.

Samuel Holland (4):
  ASoC: codec2codec: avoid invalid/double-free of pcm runtime
  ALSA: pcm: Make snd_pcm_limit_hw_rates take hw directly
  ASoC: pcm: Export parameter intersection logic
  ASoC: simple-card: Add support for codec-to-codec dai_links

 .../devicetree/bindings/sound/simple-card.txt |  1 +
 Documentation/sound/soc/codec-to-codec.rst    |  9 ++-
 .../drm/bridge/synopsys/dw-hdmi-ahb-audio.c   |  2 +-
 include/sound/pcm.h                           |  2 +-
 include/sound/simple_card_utils.h             |  1 +
 include/sound/soc.h                           |  3 +
 sound/arm/aaci.c                              |  2 +-
 sound/arm/pxa2xx-ac97.c                       |  2 +-
 sound/core/pcm_misc.c                         | 14 ++---
 sound/firewire/dice/dice-pcm.c                |  2 +-
 sound/firewire/digi00x/digi00x-pcm.c          |  2 +-
 sound/firewire/fireworks/fireworks_pcm.c      |  2 +-
 sound/firewire/motu/motu-pcm.c                |  2 +-
 sound/firewire/tascam/tascam-pcm.c            |  2 +-
 sound/pci/atiixp.c                            |  2 +-
 sound/pci/cs5535audio/cs5535audio_pcm.c       |  4 +-
 sound/pci/hda/hda_controller.c                |  4 +-
 sound/pci/intel8x0.c                          |  2 +-
 sound/pci/sis7019.c                           |  2 +-
 sound/pci/via82xx.c                           |  4 +-
 sound/soc/generic/simple-card-utils.c         | 39 +++++++++++++
 sound/soc/generic/simple-card.c               | 12 ++++
 sound/soc/soc-dapm.c                          |  3 -
 sound/soc/soc-pcm.c                           | 57 +++++++++++++------
 sound/usb/caiaq/audio.c                       |  4 +-
 25 files changed, 130 insertions(+), 49 deletions(-)