summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-ak5558.c
diff options
context:
space:
mode:
authorDaniel Baluta <daniel.baluta@nxp.com>2018-01-29 19:43:30 +0200
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:50:31 +0800
commitaa64db99e15e9d54a57d28a7c52301d37021da2b (patch)
tree7e3062b5a10905d3504c70aff5292786bafdd7da /sound/soc/fsl/imx-ak5558.c
parent9e64d031865ae791cc11de4427d623841735307c (diff)
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 <daniel.baluta@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-ak5558.c')
-rw-r--r--sound/soc/fsl/imx-ak5558.c19
1 files changed, 17 insertions, 2 deletions
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);