aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarsha Priya N <harshapriya.n@intel.com>2017-10-26 14:44:03 -0400
committerMark Brown <broonie@kernel.org>2017-10-31 07:08:35 -0400
commite78407fb7ed38fded024def7a76e4c91bc814080 (patch)
tree3d8621230df0b92c994523a31bc3641c2e9dc394
parent7a679ea75a1bc4ea6216aa6877a8bd47fd83e790 (diff)
ASoC: Intel: Fix setting of SSP parameters in Kabylake machine driver
This patch sets the SSP params based on FE and BE dai links for kabylake machine driver that uses rt5663 and max98927 codecs Signed-off-by: Naveen M <naveen.m@intel.com> Signed-off-by: Harsha Priya <harshapriya.n@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/boards/kbl_rt5663_max98927.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c
index 5a4ee5b1c6a0..6f9a8bcf20f3 100644
--- a/sound/soc/intel/boards/kbl_rt5663_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c
@@ -350,13 +350,28 @@ static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
350 struct snd_interval *channels = hw_param_interval(params, 350 struct snd_interval *channels = hw_param_interval(params,
351 SNDRV_PCM_HW_PARAM_CHANNELS); 351 SNDRV_PCM_HW_PARAM_CHANNELS);
352 struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 352 struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
353 struct snd_soc_dpcm *dpcm = container_of(
354 params, struct snd_soc_dpcm, hw_params);
355 struct snd_soc_dai_link *fe_dai_link = dpcm->fe->dai_link;
356 struct snd_soc_dai_link *be_dai_link = dpcm->be->dai_link;
353 357
354 /* The ADSP will convert the FE rate to 48k, stereo */ 358 /*
355 rate->min = rate->max = 48000; 359 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
356 channels->min = channels->max = 2; 360 */
357 /* set SSP1 to 24 bit */ 361 if (!strcmp(fe_dai_link->name, "Kbl Audio Port") ||
358 snd_mask_none(fmt); 362 !strcmp(fe_dai_link->name, "Kbl Audio Headset Playback") ||
359 snd_mask_set(fmt, SNDRV_PCM_FORMAT_S24_LE); 363 !strcmp(fe_dai_link->name, "Kbl Audio Capture Port")) {
364 rate->min = rate->max = 48000;
365 channels->min = channels->max = 2;
366 snd_mask_none(fmt);
367 snd_mask_set(fmt, SNDRV_PCM_FORMAT_S24_LE);
368 }
369 /*
370 * The speaker on the SSP0 supports S16_LE and not S24_LE.
371 * thus changing the mask here
372 */
373 if (!strcmp(be_dai_link->name, "SSP0-Codec"))
374 snd_mask_set(fmt, SNDRV_PCM_FORMAT_S16_LE);
360 375
361 return 0; 376 return 0;
362} 377}