diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-11-13 10:56:24 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-24 13:32:50 (GMT) |
commit | 3635bf09a89cf92b80ac44198c5c8f0989624ea6 (patch) | |
tree | d17b0f527cd2282e032f4820c15554ab2d8248a6 /include/sound/soc.h | |
parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) | |
download | linux-3635bf09a89cf92b80ac44198c5c8f0989624ea6.tar.xz |
ASoC: soc-pcm: add symmetry for channels and sample bits
Some SoCs can only work in mono or stereo mode at one time. So if
we let them capture a mono stream while playing a stereo stream,
there might be a problem occur to one of these two streams: double
paced or slowed down.
In soc-pcm.c, we have soc_pcm_apply_symmetry() to apply the rate
symmetry. But we don't have one for channels.
Likewise, we can treat symmetric_rate as a solution for those SoCs
or CODECs which can not handle asymmetrical LRCLK. But it's also
impossible for them to handle asymmetrical BCLK. And accodring to
BCLK = LRCLK * channel number * slot size(fixed or sample bits),
sample bits might also be a problem if they are not using a fixed
slot size.
Thus, this patch applys symmetry for channels and sample bits.
Meanwhile, there might be a race between two substreams if starting
simultaneously. Previously, we only added warning to compalin but
still using conservative way to let it carry on. However, this patch
rejects the second stream with any unmatched parameter to make sure
the first existing stream won't be broken.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 1f741cb..1cda7d3 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -879,6 +879,8 @@ struct snd_soc_dai_link { /* Symmetry requirements */ unsigned int symmetric_rates:1; + unsigned int symmetric_channels:1; + unsigned int symmetric_samplebits:1; /* Do not create a PCM for this DAI link (Backend link) */ unsigned int no_pcm:1; |