summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-04-02 11:39:00 +0800
committerFrank Li <Frank.Li@freescale.com>2015-04-24 23:03:10 +0800
commit7d58e665e2caf4243edbcd3b3f8991acbd43f059 (patch)
tree81f821622a016818f8cddaad5e32e4685830dc6a /sound
parent101cd25b2fe2c101038259202f4ce114bd53fc0b (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.c14
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;
}