diff options
author | Senthilnathan Veppur <senthilnathanx.veppur@intel.com> | 2016-06-13 08:28:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-14 09:59:33 -0400 |
commit | 4cdf33feb2c67ef1ff45bc5160b261b8c1fd2428 (patch) | |
tree | d105486825d9d8f9ff465238b566dc10b5d89195 /sound/soc/intel | |
parent | bfcdc6d19008c0f11cba30c2cff1b63ec4e7a744 (diff) |
ASoC: Intel: Add FE rate & channel constraints for bxt-rt298
We support stereo 48Khz audio, so add these as constraints
for this card
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r-- | sound/soc/intel/boards/bxt_rt298.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 9b649b6cc757..10eb5cbf57e4 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c | |||
@@ -220,6 +220,40 @@ static struct snd_soc_ops broxton_dmic_ops = { | |||
220 | .startup = broxton_dmic_startup, | 220 | .startup = broxton_dmic_startup, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | static unsigned int channels[] = { | ||
224 | 2, | ||
225 | }; | ||
226 | |||
227 | static struct snd_pcm_hw_constraint_list constraints_channels = { | ||
228 | .count = ARRAY_SIZE(channels), | ||
229 | .list = channels, | ||
230 | .mask = 0, | ||
231 | }; | ||
232 | |||
233 | static int bxt_fe_startup(struct snd_pcm_substream *substream) | ||
234 | { | ||
235 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
236 | |||
237 | /* | ||
238 | * on this platform for PCM device we support: | ||
239 | * 48Khz | ||
240 | * stereo | ||
241 | */ | ||
242 | |||
243 | runtime->hw.channels_max = 2; | ||
244 | snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, | ||
245 | &constraints_channels); | ||
246 | |||
247 | snd_pcm_hw_constraint_list(runtime, 0, | ||
248 | SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); | ||
249 | |||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | static const struct snd_soc_ops broxton_rt286_fe_ops = { | ||
254 | .startup = bxt_fe_startup, | ||
255 | }; | ||
256 | |||
223 | /* broxton digital audio interface glue - connects codec <--> CPU */ | 257 | /* broxton digital audio interface glue - connects codec <--> CPU */ |
224 | static struct snd_soc_dai_link broxton_rt298_dais[] = { | 258 | static struct snd_soc_dai_link broxton_rt298_dais[] = { |
225 | /* Front End DAI links */ | 259 | /* Front End DAI links */ |
@@ -235,6 +269,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { | |||
235 | .codec_dai_name = "snd-soc-dummy-dai", | 269 | .codec_dai_name = "snd-soc-dummy-dai", |
236 | .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, | 270 | .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
237 | .dpcm_playback = 1, | 271 | .dpcm_playback = 1, |
272 | .ops = &broxton_rt286_fe_ops, | ||
238 | }, | 273 | }, |
239 | [BXT_DPCM_AUDIO_CP] | 274 | [BXT_DPCM_AUDIO_CP] |
240 | { | 275 | { |
@@ -248,6 +283,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { | |||
248 | .codec_dai_name = "snd-soc-dummy-dai", | 283 | .codec_dai_name = "snd-soc-dummy-dai", |
249 | .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, | 284 | .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
250 | .dpcm_capture = 1, | 285 | .dpcm_capture = 1, |
286 | .ops = &broxton_rt286_fe_ops, | ||
251 | }, | 287 | }, |
252 | [BXT_DPCM_AUDIO_REF_CP] | 288 | [BXT_DPCM_AUDIO_REF_CP] |
253 | { | 289 | { |