diff options
author | Zidan Wang <zidan.wang@freescale.com> | 2015-04-02 11:39:00 +0800 |
---|---|---|
committer | guoyin.chen <guoyin.chen@freescale.com> | 2015-05-08 17:24:58 +0800 |
commit | 11357d70ba0f311fef968ef91f7c86c4d133abbc (patch) | |
tree | 8b9c2f06f7c80f9a2ff7d0c5f3188c3e2eedda1a | |
parent | bf62109c6231268a1045f3479d2269514ebc3fe0 (diff) |
MLK-10556 ASoC: imx-wm8958: wm8958 can't support dac sample rate 64kHZ
wm8958 can't support dac sample rate 64kHZ, so add a constraint
list for it.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
-rw-r--r-- | sound/soc/fsl/imx-wm8958.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-wm8958.c b/sound/soc/fsl/imx-wm8958.c index 544f8b276692..fb0399c55159 100644 --- a/sound/soc/fsl/imx-wm8958.c +++ b/sound/soc/fsl/imx-wm8958.c @@ -228,16 +228,27 @@ static int imx_hifi_hw_free(struct snd_pcm_substream *substream) return 0; } + static u32 imx_wm8958_adc_rates[] = { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }; +static u32 imx_wm8958_dac_rates[] = { + 8000, 11025, 12000, 16000, 22050, + 24000, 32000, 44100, 48000, 88200, 96000 +}; + static struct snd_pcm_hw_constraint_list imx_wm8958_adc_rate_constraints = { .count = ARRAY_SIZE(imx_wm8958_adc_rates), .list = imx_wm8958_adc_rates, }; +static struct snd_pcm_hw_constraint_list imx_wm8958_dac_rate_constraints = { + .count = ARRAY_SIZE(imx_wm8958_dac_rates), + .list = imx_wm8958_dac_rates, +}; + static int imx_hifi_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -256,6 +267,9 @@ static int imx_hifi_startup(struct snd_pcm_substream *substream) if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ret = snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &imx_wm8958_adc_rate_constraints); + else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + ret = snd_pcm_hw_constraint_list(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, &imx_wm8958_dac_rate_constraints); return ret; } |