aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/sunxi/sun4i-codec.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 5da4efe7a550..886281673972 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -590,12 +590,28 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream,
590 hwrate); 590 hwrate);
591} 591}
592 592
593
594static unsigned int sun4i_codec_src_rates[] = {
595 8000, 11025, 12000, 16000, 22050, 24000, 32000,
596 44100, 48000, 96000, 192000
597};
598
599
600static struct snd_pcm_hw_constraint_list sun4i_codec_constraints = {
601 .count = ARRAY_SIZE(sun4i_codec_src_rates),
602 .list = sun4i_codec_src_rates,
603};
604
605
593static int sun4i_codec_startup(struct snd_pcm_substream *substream, 606static int sun4i_codec_startup(struct snd_pcm_substream *substream,
594 struct snd_soc_dai *dai) 607 struct snd_soc_dai *dai)
595{ 608{
596 struct snd_soc_pcm_runtime *rtd = substream->private_data; 609 struct snd_soc_pcm_runtime *rtd = substream->private_data;
597 struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); 610 struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card);
598 611
612 snd_pcm_hw_constraint_list(substream->runtime, 0,
613 SNDRV_PCM_HW_PARAM_RATE, &sun4i_codec_constraints);
614
599 /* 615 /*
600 * Stop issuing DRQ when we have room for less than 16 samples 616 * Stop issuing DRQ when we have room for less than 16 samples
601 * in our TX FIFO 617 * in our TX FIFO
@@ -633,9 +649,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = {
633 .channels_max = 2, 649 .channels_max = 2,
634 .rate_min = 8000, 650 .rate_min = 8000,
635 .rate_max = 192000, 651 .rate_max = 192000,
636 .rates = SNDRV_PCM_RATE_8000_48000 | 652 .rates = SNDRV_PCM_RATE_CONTINUOUS,
637 SNDRV_PCM_RATE_96000 |
638 SNDRV_PCM_RATE_192000,
639 .formats = SNDRV_PCM_FMTBIT_S16_LE | 653 .formats = SNDRV_PCM_FMTBIT_S16_LE |
640 SNDRV_PCM_FMTBIT_S32_LE, 654 SNDRV_PCM_FMTBIT_S32_LE,
641 .sig_bits = 24, 655 .sig_bits = 24,
@@ -645,11 +659,8 @@ static struct snd_soc_dai_driver sun4i_codec_dai = {
645 .channels_min = 1, 659 .channels_min = 1,
646 .channels_max = 2, 660 .channels_max = 2,
647 .rate_min = 8000, 661 .rate_min = 8000,
648 .rate_max = 192000, 662 .rate_max = 48000,
649 .rates = SNDRV_PCM_RATE_8000_48000 | 663 .rates = SNDRV_PCM_RATE_CONTINUOUS,
650 SNDRV_PCM_RATE_96000 |
651 SNDRV_PCM_RATE_192000 |
652 SNDRV_PCM_RATE_KNOT,
653 .formats = SNDRV_PCM_FMTBIT_S16_LE | 664 .formats = SNDRV_PCM_FMTBIT_S16_LE |
654 SNDRV_PCM_FMTBIT_S32_LE, 665 SNDRV_PCM_FMTBIT_S32_LE,
655 .sig_bits = 24, 666 .sig_bits = 24,
@@ -1128,7 +1139,7 @@ static const struct snd_soc_component_driver sun4i_codec_component = {
1128 .name = "sun4i-codec", 1139 .name = "sun4i-codec",
1129}; 1140};
1130 1141
1131#define SUN4I_CODEC_RATES SNDRV_PCM_RATE_8000_192000 1142#define SUN4I_CODEC_RATES SNDRV_PCM_RATE_CONTINUOUS
1132#define SUN4I_CODEC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ 1143#define SUN4I_CODEC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
1133 SNDRV_PCM_FMTBIT_S32_LE) 1144 SNDRV_PCM_FMTBIT_S32_LE)
1134 1145