ASoC: Use a shared define for AC97 CODEC data formats
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 2 May 2009 11:24:55 +0000 (12:24 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 2 May 2009 11:32:09 +0000 (12:32 +0100)
The AC97 wire format is completely fixed so CODECs don't have any choice
about the formats they accept but controllers accept a variety of data
formats and render them down onto the bus.  Have a shared define so all
the CODEC drivers will interoperate with any of our controller drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc-dai.h
sound/soc/codecs/ac97.c
sound/soc/codecs/ad1980.c
sound/soc/codecs/wm9705.c
sound/soc/codecs/wm9712.c
sound/soc/codecs/wm9713.c

index 22b729fbbf844326f6b2411daab80197e2fee74b..ea07b4bd516189964b9b1abf9f0ff9624abab122 100644 (file)
@@ -96,6 +96,9 @@ struct snd_pcm_substream;
 #define SND_SOC_CLOCK_IN               0
 #define SND_SOC_CLOCK_OUT              1
 
+#define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\
+                               SNDRV_PCM_FMTBIT_S32_LE)
+
 struct snd_soc_dai_ops;
 struct snd_soc_dai;
 struct snd_ac97_bus_ops;
index b0d4af145b873900509ce18239e2c85899aa9069..932299bb5d1e006a7f0108bd7d7ab0000b3969bc 100644 (file)
@@ -53,13 +53,13 @@ struct snd_soc_dai ac97_dai = {
                .channels_min = 1,
                .channels_max = 2,
                .rates = STD_AC97_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .capture = {
                .stream_name = "AC97 Capture",
                .channels_min = 1,
                .channels_max = 2,
                .rates = STD_AC97_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .ops = &ac97_dai_ops,
 };
 EXPORT_SYMBOL_GPL(ac97_dai);
index ddb3b08ac23c441dd93112295a7182881c856041..d7440a982d22794928940c3590cde1765fe56d9a 100644 (file)
@@ -137,13 +137,13 @@ struct snd_soc_dai ad1980_dai = {
                .channels_min = 2,
                .channels_max = 6,
                .rates = SNDRV_PCM_RATE_48000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE, },
+               .formats = SND_SOC_STD_AC97_FMTS, },
        .capture = {
                .stream_name = "Capture",
                .channels_min = 2,
                .channels_max = 2,
                .rates = SNDRV_PCM_RATE_48000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE, },
+               .formats = SND_SOC_STD_AC97_FMTS, },
 };
 EXPORT_SYMBOL_GPL(ad1980_dai);
 
index c2d1a7a18fa3893757eef782372fa976314702e6..fa88b463e71f37f4a07bc830db69c50d2e52b39c 100644 (file)
@@ -282,14 +282,14 @@ struct snd_soc_dai wm9705_dai[] = {
                        .channels_min = 1,
                        .channels_max = 2,
                        .rates = WM9705_AC97_RATES,
-                       .formats = SNDRV_PCM_FMTBIT_S16_LE,
+                       .formats = SND_SOC_STD_AC97_FMTS,
                },
                .capture = {
                        .stream_name = "HiFi Capture",
                        .channels_min = 1,
                        .channels_max = 2,
                        .rates = WM9705_AC97_RATES,
-                       .formats = SNDRV_PCM_FMTBIT_S16_LE,
+                       .formats = SND_SOC_STD_AC97_FMTS,
                },
                .ops = &wm9705_dai_ops,
        },
index 765cf1e7369eb37c3a8f85a5e8257a22c2957f8e..550c903f23bf3dbd1ab7a5fb275b746c8fcc84c4 100644 (file)
@@ -534,13 +534,13 @@ struct snd_soc_dai wm9712_dai[] = {
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM9712_AC97_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .capture = {
                .stream_name = "HiFi Capture",
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM9712_AC97_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .ops = &wm9712_dai_ops_hifi,
 },
 {
@@ -550,7 +550,7 @@ struct snd_soc_dai wm9712_dai[] = {
                .channels_min = 1,
                .channels_max = 1,
                .rates = WM9712_AC97_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .ops = &wm9712_dai_ops_aux,
 }
 };
index a6feb78423149ba449c67c9fdc4bdab6b0993e75..d1744e96f3030241b9e34cd8932d8b1f3a296d21 100644 (file)
@@ -1040,13 +1040,13 @@ struct snd_soc_dai wm9713_dai[] = {
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM9713_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .capture = {
                .stream_name = "HiFi Capture",
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM9713_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .ops = &wm9713_dai_ops_hifi,
        },
        {
@@ -1056,7 +1056,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .channels_min = 1,
                .channels_max = 1,
                .rates = WM9713_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,},
+               .formats = SND_SOC_STD_AC97_FMTS,},
        .ops = &wm9713_dai_ops_aux,
        },
        {