From aa64db99e15e9d54a57d28a7c52301d37021da2b Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 29 Jan 2018 19:43:30 +0200 Subject: ASoC: imx-ak5558: Add support for 384KHz and 768KHz In normal mode we need to test SAI capability of supporting higher rates so adjust constraints list to allow 384KHz and 768KHz. Signed-off-by: Daniel Baluta Reviewed-by: Shengjiu Wang --- sound/soc/fsl/imx-ak5558.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sound/soc/fsl/imx-ak5558.c') diff --git a/sound/soc/fsl/imx-ak5558.c b/sound/soc/fsl/imx-ak5558.c index ccb5169afabe..2c5bfcf512b8 100644 --- a/sound/soc/fsl/imx-ak5558.c +++ b/sound/soc/fsl/imx-ak5558.c @@ -35,6 +35,12 @@ static struct snd_soc_dapm_widget imx_ak5558_dapm_widgets[] = { static const u32 ak5558_rates[] = { 8000, 16000, 32000, 48000, 96000, 192000, + 384000, 768000, +}; + +static const u32 ak5558_tdm_rates[] = { + 8000, 16000, 32000, + 48000, 96000, 192000, }; static const u32 ak5558_channels[] = { @@ -105,12 +111,21 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream, static int imx_aif_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_card *card = rtd->card; + struct imx_ak5558_data *data = snd_soc_card_get_drvdata(card); + static struct snd_pcm_hw_constraint_list constraint_rates; static struct snd_pcm_hw_constraint_list constraint_channels; int ret; - constraint_rates.list = ak5558_rates; - constraint_rates.count = ARRAY_SIZE(ak5558_rates); + if (data->tdm_mode) { + constraint_rates.list = ak5558_tdm_rates; + constraint_rates.count = ARRAY_SIZE(ak5558_tdm_rates); + } else { + constraint_rates.list = ak5558_rates; + constraint_rates.count = ARRAY_SIZE(ak5558_rates); + } ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraint_rates); -- cgit v1.2.3