ASoC: support all possible sample rates in the WM8776 driver
authorTimur Tabi <timur@freescale.com>
Fri, 16 Sep 2011 14:16:54 +0000 (09:16 -0500)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 16 Sep 2011 16:35:18 +0000 (17:35 +0100)
The WM8776 supports a continuous range of sample rates rather than
discrete values and supports a wider range of sample rates on the
playback path than is currently supported.  Update the constraints on
the DAIs to reflect this.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8776.c

index 5b17627aab0f58ecb55dbd6934a200181b1e65ff..00d8846fae8ae67de92be460d4233fb4b4a431d5 100644 (file)
@@ -322,11 +322,6 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec,
        return 0;
 }
 
-#define WM8776_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
-                     SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
-                     SNDRV_PCM_RATE_96000)
-
-
 #define WM8776_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
@@ -351,7 +346,9 @@ static struct snd_soc_dai_driver wm8776_dai[] = {
                        .stream_name = "Playback",
                        .channels_min = 2,
                        .channels_max = 2,
-                       .rates = WM8776_RATES,
+                       .rates = SNDRV_PCM_RATE_CONTINUOUS,
+                       .rate_min = 32000,
+                       .rate_max = 192000,
                        .formats = WM8776_FORMATS,
                },
                .ops = &wm8776_dac_ops,
@@ -363,7 +360,9 @@ static struct snd_soc_dai_driver wm8776_dai[] = {
                        .stream_name = "Capture",
                        .channels_min = 2,
                        .channels_max = 2,
-                       .rates = WM8776_RATES,
+                       .rates = SNDRV_PCM_RATE_CONTINUOUS,
+                       .rate_min = 32000,
+                       .rate_max = 96000,
                        .formats = WM8776_FORMATS,
                },
                .ops = &wm8776_adc_ops,