diff options
author | Zidan Wang <zidan.wang@freescale.com> | 2015-04-02 11:39:00 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2015-05-08 17:23:58 +0800 |
commit | 4aa7edb12a2a7fe0e171d25478638f60c39d39ab (patch) | |
tree | 659f4c84646d71d74b47ce42bf9cca47a990193e /sound | |
parent | 2bd56e2143356a7341f1b4e28c64d6bc0c877730 (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>
Diffstat (limited to 'sound')
-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; } |