diff options
author | Zidan Wang <zidan.wang@freescale.com> | 2015-04-02 17:48:48 +0800 |
---|---|---|
committer | Frank Li <Frank.Li@freescale.com> | 2015-04-24 23:03:12 +0800 |
commit | 1bed3dddf0e37c123ab4e3602a62f3f2f9839399 (patch) | |
tree | 92bb29065a9a2c5df9772163cb3cd1507ae08475 /sound/soc | |
parent | 12a3fc5db91e454f4c1b8e28fd39f119eb67102f (diff) |
MLK-10108-2: ASoC: imx-mqs: set tdm slot in hw_params() for sai master mode
Set tdm slot in hw_params() for sai master mode.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/fsl/imx-mqs.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sound/soc/fsl/imx-mqs.c b/sound/soc/fsl/imx-mqs.c index 0a1c2ef94d47..7ef07f7ad22e 100644 --- a/sound/soc/fsl/imx-mqs.c +++ b/sound/soc/fsl/imx-mqs.c @@ -15,6 +15,7 @@ #include <linux/of.h> #include <linux/of_platform.h> #include <sound/soc.h> +#include <sound/pcm_params.h> #define SUPPORT_RATE_NUM 10 @@ -51,12 +52,27 @@ static int imx_mqs_startup(struct snd_pcm_substream *substream) return 0; } +static int imx_mqs_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_card *card = rtd->card; + int ret; + + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0, 2, params_width(params)); + if (ret) { + dev_err(card->dev, "failed to set cpu dai tdm slot: %d\n", ret); + return ret; + } + return 0; +} + static struct snd_soc_ops imx_mqs_ops = { .startup = imx_mqs_startup, + .hw_params = imx_mqs_hw_params, }; - - static struct snd_soc_dai_link imx_mqs_dai = { .name = "HiFi", .stream_name = "HiFi", |