4036fc5d6da728cf356a0436ad80986eb815e64e
[oweals/openwrt.git] /
1 From d72ed21ec11a87f1fdc0d58f7af1dada3361d57b Mon Sep 17 00:00:00 2001
2 From: Matthias Reichl <hias@horus.com>
3 Date: Sun, 7 May 2017 16:19:54 +0200
4 Subject: [PATCH 117/454] ASoC: bcm2835: Support additional samplerates up to
5  384kHz
6
7 Sample rates are only restricted by the capabilities of the
8 clock driver, so use SNDRV_PCM_RATE_CONTINUOUS instead of
9 SNDRV_PCM_RATE_8000_192000.
10
11 Tests (eg with pcm5122) have shown that bcm2835 works fine
12 in 384kHz/32bit stereo mode, so change the maximum allowed
13 rate from 192kHz to 384kHz.
14
15 Signed-off-by: Matthias Reichl <hias@horus.com>
16 ---
17  sound/soc/bcm/bcm2835-i2s.c | 8 ++++++--
18  1 file changed, 6 insertions(+), 2 deletions(-)
19
20 --- a/sound/soc/bcm/bcm2835-i2s.c
21 +++ b/sound/soc/bcm/bcm2835-i2s.c
22 @@ -765,7 +765,9 @@ static struct snd_soc_dai_driver bcm2835
23         .playback = {
24                 .channels_min = 2,
25                 .channels_max = 2,
26 -               .rates =        SNDRV_PCM_RATE_8000_192000,
27 +               .rates =        SNDRV_PCM_RATE_CONTINUOUS,
28 +               .rate_min =     8000,
29 +               .rate_max =     384000,
30                 .formats =      SNDRV_PCM_FMTBIT_S16_LE
31                                 | SNDRV_PCM_FMTBIT_S24_LE
32                                 | SNDRV_PCM_FMTBIT_S32_LE
33 @@ -773,7 +775,9 @@ static struct snd_soc_dai_driver bcm2835
34         .capture = {
35                 .channels_min = 2,
36                 .channels_max = 2,
37 -               .rates =        SNDRV_PCM_RATE_8000_192000,
38 +               .rates =        SNDRV_PCM_RATE_CONTINUOUS,
39 +               .rate_min =     8000,
40 +               .rate_max =     384000,
41                 .formats =      SNDRV_PCM_FMTBIT_S16_LE
42                                 | SNDRV_PCM_FMTBIT_S24_LE
43                                 | SNDRV_PCM_FMTBIT_S32_LE