Skip to content

ASoC: audio_graph_card2: Support variable slot widths

Richard Fitzgerald alsa-devel linux-devicetree lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Change property type to uint32-matrix.
- Put min/max ranges on cells.
- Use per-item description to document the tuple entries.
- Add a slot count to the tuple - it's unlikely that this would change for different sample rates but it's trivial to implement support for it.
- Minor tidying of the code in asoc_simple_parse_tdm_width_map() and asoc_simple_set_tdm().

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ASoC: dt-bindings: audio-graph-port: Add dai-tdm-slot-width-mapDocumentation/devicetree/bindings/sound/audio-graph-port.yaml+20 -00 replies
2/2ASoC: audio_graph_card2: Add support for variable slot widthsinclude/sound/simple_card_utils.h sound/soc/generic/audio-graph-card2.c sound/soc/generic/simple-card-utils.c+112 -00 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/2] ASoC: audio_graph_card2: Support variable slot widths

This adds support for I2S/TDM links where the slot width varies depending on the sample width, in a way that cannot be guessed by component hw_params().

A typical example is:

- 16-bit samples use 16-bit slots
- 24-bit samples use 32-bit slots

There is no way for a component hw_params() to deduce from the information it is passed that 24-bit samples will be in 32-bit slots.

Some audio hardware cannot support a fixed slot width or a slot width equal to the sample width in all cases. This is usually due either to limitations of the audio serial port or system clocking restrictions.

These two patches add support for defining a mapping between sample widths and sample slots. This allows audio_graph_card2 to be used in these situations instead of having to write a custom machine driver.

Changes since V2:
- Change property type to uint32-matrix.
- Put min/max ranges on cells.
- Use per-item description to document the tuple entries.
- Add a slot count to the tuple - it's unlikely that this would change for different sample rates but it's trivial to implement support for it.
- Minor tidying of the code in asoc_simple_parse_tdm_width_map() and asoc_simple_set_tdm().

Richard Fitzgerald (2):
ASoC: dt-bindings: audio-graph-port: Add dai-tdm-slot-width-map
ASoC: audio_graph_card2: Add support for variable slot widths

 .../bindings/sound/audio-graph-port.yaml      | 20 ++++
 include/sound/simple_card_utils.h             | 11 +++
 sound/soc/generic/audio-graph-card2.c         |  4 +
 sound/soc/generic/simple-card-utils.c         | 97 +++++++++++++++++++
 4 files changed, 132 insertions(+)
Signature · 1 line
2.30.2