linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: audio_graph_card2: Support variable slot widths
@ 2022-02-16 17:14 Richard Fitzgerald
  2022-02-16 17:14 ` [PATCH 1/2] ASoC: dt-bindings: audio-graph-port: Add dai-tdm-slot-width-map Richard Fitzgerald
  2022-02-16 17:14 ` [PATCH 2/2] ASoC: audio_graph_card2: Add support for variable slot widths Richard Fitzgerald
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Fitzgerald @ 2022-02-16 17:14 UTC (permalink / raw)
  To: broonie, robh+dt, kuninori.morimoto.gx
  Cc: alsa-devel, devicetree, linux-kernel, patches, Richard Fitzgerald

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.

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      |  7 ++
 include/sound/simple_card_utils.h             | 11 +++
 sound/soc/generic/audio-graph-card2.c         |  4 +
 sound/soc/generic/simple-card-utils.c         | 95 +++++++++++++++++++
 4 files changed, 117 insertions(+)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-17 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 17:14 [PATCH 0/2] ASoC: audio_graph_card2: Support variable slot widths Richard Fitzgerald
2022-02-16 17:14 ` [PATCH 1/2] ASoC: dt-bindings: audio-graph-port: Add dai-tdm-slot-width-map Richard Fitzgerald
2022-02-16 17:14 ` [PATCH 2/2] ASoC: audio_graph_card2: Add support for variable slot widths Richard Fitzgerald
2022-02-17  0:23   ` Kuninori Morimoto
2022-02-17 12:51     ` Richard Fitzgerald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).