Commit 0e2a3751 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Takashi Iwai

ASoC: pcm: Use wildcard msbits constraints

Use the new wildcard msbits constraints instead of installing a constraint
for each available sample format width.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8ef9df55
...@@ -301,15 +301,6 @@ static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream) ...@@ -301,15 +301,6 @@ static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream)
return symmetry; return symmetry;
} }
/*
* List of sample sizes that might go over the bus for parameter
* application. There ought to be a wildcard sample size for things
* like the DAC/ADC resolution to use but there isn't right now.
*/
static int sample_sizes[] = {
24, 32,
};
static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits) static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
...@@ -318,17 +309,10 @@ static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits) ...@@ -318,17 +309,10 @@ static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits)
if (!bits) if (!bits)
return; return;
for (i = 0; i < ARRAY_SIZE(sample_sizes); i++) { ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 0, bits);
if (bits >= sample_sizes[i])
continue;
ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0,
sample_sizes[i], bits);
if (ret != 0) if (ret != 0)
dev_warn(rtd->dev, dev_warn(rtd->dev, "ASoC: Failed to set MSB %d: %d\n",
"ASoC: Failed to set MSB %d/%d: %d\n", bits, ret);
bits, sample_sizes[i], ret);
}
} }
static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment