summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-19 19:04:18 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-21 22:15:37 +0100
commit278047fd654dde7ed95c8604fcefeeacc5c0bb2b (patch)
tree306d088ca76a4e64fa132702ba050ae46de36075 /sound/soc/soc-pcm.c
parentASoC: Push WM5100 interrupt request into I2C probe (diff)
downloadlinux-278047fd654dde7ed95c8604fcefeeacc5c0bb2b.tar.xz
linux-278047fd654dde7ed95c8604fcefeeacc5c0bb2b.zip
ASoC: Don't tell applications about msbits unless we're ignoring input
On the off chance that an application both pays attention and gets confused. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to '')
-rw-r--r--sound/soc/soc-pcm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8bb17937d59a..326890148a26 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -85,9 +85,11 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream,
return;
for (i = 0; i < ARRAY_SIZE(sample_sizes); i++) {
- ret = snd_pcm_hw_constraint_msbits(substream->runtime,
- 0, sample_sizes[i],
- bits);
+ if (bits >= sample_sizes[i])
+ continue;
+
+ ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0,
+ sample_sizes[i], bits);
if (ret != 0)
dev_warn(dai->dev,
"Failed to set MSB %d/%d: %d\n",