summaryrefslogtreecommitdiff
path: root/sound/soc/generic/audio-graph-card2.c
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2022-02-28 20:27:54 +0300
committerMark Brown <broonie@kernel.org>2022-03-07 16:12:58 +0300
commit1e974e5b82b3d75069b50445cd248cee0199654e (patch)
tree86b9ef425eaf26b4793ffa1180fb0f5098352717 /sound/soc/generic/audio-graph-card2.c
parent26e5366dd30569a469e1a87998b866b814deccf8 (diff)
downloadlinux-1e974e5b82b3d75069b50445cd248cee0199654e.tar.xz
ASoC: audio_graph_card2: Add support for variable slot widths
Some audio hardware cannot support the same slot width for all sample widths, or a slot width equal to the sample width for all sample widths. This is usually due either to limitations of the audio serial port or system clocking restrictions. A typical example would be: - 16-bit samples in 16-bit slots - 24-bit samples in 32-bit slots The new dai-tdm-slot-width-map property allows setting a mapping of sample widths and the corresponding tdm slot widths and slot counts. Although the slot count is usually the same for all cases this does allow for adding padding slots to maintain the same bitclk frequency. The property is added to each endpoint node that needs the component DAI to be told the TDM slot width and count. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220228172754.453783-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/audio-graph-card2.c')
-rw-r--r--sound/soc/generic/audio-graph-card2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index c3947347dda3..c0f3907a01fd 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -503,6 +503,10 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
if (ret < 0)
return ret;
+ ret = asoc_simple_parse_tdm_width_map(dev, ep, dai);
+ if (ret < 0)
+ return ret;
+
ret = asoc_simple_parse_clk(dev, ep, dai, dlc);
if (ret < 0)
return ret;