diff options
author | Jeeja KP <jeeja.kp@intel.com> | 2015-12-03 12:59:57 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-12-08 12:57:51 -0500 |
commit | 4386b76753c49dfdb940c0e5eeef09b61feaf712 (patch) | |
tree | 32152d71627a0d78e2387e2895913c40876de6e4 /sound/soc/intel/boards/skl_rt286.c | |
parent | 7d9f29119d3e4db6ae817881d8e305650424032c (diff) |
ASoC: Intel: Skylake: Add dai link for DMIC capture
Since in Skylake we support another DAI for DMIC quad capture,
add a dailink for this as well. Also specify constrains for DMIC
FE devices and fixup for DMIC BEs
Signed-off-by: Dharageswari.R <dharageswari.r@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@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/boards/skl_rt286.c')
-rw-r--r-- | sound/soc/intel/boards/skl_rt286.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/skl_rt286.c b/sound/soc/intel/boards/skl_rt286.c index 57333a476136..e4fc8a1ce471 100644 --- a/sound/soc/intel/boards/skl_rt286.c +++ b/sound/soc/intel/boards/skl_rt286.c | |||
@@ -190,6 +190,42 @@ static struct snd_soc_ops skylake_rt286_ops = { | |||
190 | .hw_params = skylake_rt286_hw_params, | 190 | .hw_params = skylake_rt286_hw_params, |
191 | }; | 191 | }; |
192 | 192 | ||
193 | static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd, | ||
194 | struct snd_pcm_hw_params *params) | ||
195 | { | ||
196 | struct snd_interval *channels = hw_param_interval(params, | ||
197 | SNDRV_PCM_HW_PARAM_CHANNELS); | ||
198 | channels->min = channels->max = 4; | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static unsigned int channels_dmic[] = { | ||
204 | 2, 4, | ||
205 | }; | ||
206 | |||
207 | static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { | ||
208 | .count = ARRAY_SIZE(channels_dmic), | ||
209 | .list = channels_dmic, | ||
210 | .mask = 0, | ||
211 | }; | ||
212 | |||
213 | static int skylake_dmic_startup(struct snd_pcm_substream *substream) | ||
214 | { | ||
215 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
216 | |||
217 | runtime->hw.channels_max = 4; | ||
218 | snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, | ||
219 | &constraints_dmic_channels); | ||
220 | |||
221 | return snd_pcm_hw_constraint_list(substream->runtime, 0, | ||
222 | SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); | ||
223 | } | ||
224 | |||
225 | static struct snd_soc_ops skylake_dmic_ops = { | ||
226 | .startup = skylake_dmic_startup, | ||
227 | }; | ||
228 | |||
193 | /* skylake digital audio interface glue - connects codec <--> CPU */ | 229 | /* skylake digital audio interface glue - connects codec <--> CPU */ |
194 | static struct snd_soc_dai_link skylake_rt286_dais[] = { | 230 | static struct snd_soc_dai_link skylake_rt286_dais[] = { |
195 | /* Front End DAI links */ | 231 | /* Front End DAI links */ |
@@ -238,6 +274,20 @@ static struct snd_soc_dai_link skylake_rt286_dais[] = { | |||
238 | .nonatomic = 1, | 274 | .nonatomic = 1, |
239 | .dynamic = 1, | 275 | .dynamic = 1, |
240 | }, | 276 | }, |
277 | { | ||
278 | .name = "Skl Audio DMIC cap", | ||
279 | .stream_name = "dmiccap", | ||
280 | .cpu_dai_name = "DMIC Pin", | ||
281 | .codec_name = "snd-soc-dummy", | ||
282 | .codec_dai_name = "snd-soc-dummy-dai", | ||
283 | .platform_name = "0000:00:1f.3", | ||
284 | .init = NULL, | ||
285 | .dpcm_capture = 1, | ||
286 | .ignore_suspend = 1, | ||
287 | .nonatomic = 1, | ||
288 | .dynamic = 1, | ||
289 | .ops = &skylake_dmic_ops, | ||
290 | }, | ||
241 | 291 | ||
242 | /* Back End DAI links */ | 292 | /* Back End DAI links */ |
243 | { | 293 | { |
@@ -267,6 +317,7 @@ static struct snd_soc_dai_link skylake_rt286_dais[] = { | |||
267 | .codec_name = "dmic-codec", | 317 | .codec_name = "dmic-codec", |
268 | .codec_dai_name = "dmic-hifi", | 318 | .codec_dai_name = "dmic-hifi", |
269 | .platform_name = "0000:00:1f.3", | 319 | .platform_name = "0000:00:1f.3", |
320 | .be_hw_params_fixup = skylake_dmic_fixup, | ||
270 | .ignore_suspend = 1, | 321 | .ignore_suspend = 1, |
271 | .dpcm_capture = 1, | 322 | .dpcm_capture = 1, |
272 | .no_pcm = 1, | 323 | .no_pcm = 1, |