aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-10-18 09:39:32 -0400
committerTakashi Iwai <tiwai@suse.de>2015-10-21 08:26:11 -0400
commit3d6a76c48e7b6a80f1311a7ec71db0c6208c6de4 (patch)
treed51f32850039fbedecdd5b706815793ed377a217
parenta6553a24d44f30aa0ae3ca3bff736d346c9d42d6 (diff)
ASoC: cht_bsw_rt5645: Use snd_pcm_hw_constraint_single()
Use the new snd_pcm_hw_constraint_single() helper function rather than installing a list constraint with a single value. Since snd_pcm_hw_constraint_single() sets a static constraint while snd_pcm_hw_constraint_list() sets a dynamic constraint the former is slightly more efficient and it also needs less code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5645.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 7be8461e4d3b..38d65a3529c4 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -235,20 +235,10 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
235 return 0; 235 return 0;
236} 236}
237 237
238static unsigned int rates_48000[] = {
239 48000,
240};
241
242static struct snd_pcm_hw_constraint_list constraints_48000 = {
243 .count = ARRAY_SIZE(rates_48000),
244 .list = rates_48000,
245};
246
247static int cht_aif1_startup(struct snd_pcm_substream *substream) 238static int cht_aif1_startup(struct snd_pcm_substream *substream)
248{ 239{
249 return snd_pcm_hw_constraint_list(substream->runtime, 0, 240 return snd_pcm_hw_constraint_single(substream->runtime,
250 SNDRV_PCM_HW_PARAM_RATE, 241 SNDRV_PCM_HW_PARAM_RATE, 48000);
251 &constraints_48000);
252} 242}
253 243
254static struct snd_soc_ops cht_aif1_ops = { 244static struct snd_soc_ops cht_aif1_ops = {