ASoC: Use a shared define for AC97 CODEC data formats

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>
This commit is contained in:
Mark Brown
2009-05-02 12:24:55 +01:00
parent 71437552f2
commit 33f503c96c
6 changed files with 15 additions and 12 deletions

View File

@@ -96,6 +96,9 @@ struct snd_pcm_substream;
#define SND_SOC_CLOCK_IN 0 #define SND_SOC_CLOCK_IN 0
#define SND_SOC_CLOCK_OUT 1 #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_ops;
struct snd_soc_dai; struct snd_soc_dai;
struct snd_ac97_bus_ops; struct snd_ac97_bus_ops;

View File

@@ -53,13 +53,13 @@ struct snd_soc_dai ac97_dai = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = STD_AC97_RATES, .rates = STD_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.capture = { .capture = {
.stream_name = "AC97 Capture", .stream_name = "AC97 Capture",
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = STD_AC97_RATES, .rates = STD_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.ops = &ac97_dai_ops, .ops = &ac97_dai_ops,
}; };
EXPORT_SYMBOL_GPL(ac97_dai); EXPORT_SYMBOL_GPL(ac97_dai);

View File

@@ -137,13 +137,13 @@ struct snd_soc_dai ad1980_dai = {
.channels_min = 2, .channels_min = 2,
.channels_max = 6, .channels_max = 6,
.rates = SNDRV_PCM_RATE_48000, .rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE, }, .formats = SND_SOC_STD_AC97_FMTS, },
.capture = { .capture = {
.stream_name = "Capture", .stream_name = "Capture",
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_48000, .rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE, }, .formats = SND_SOC_STD_AC97_FMTS, },
}; };
EXPORT_SYMBOL_GPL(ad1980_dai); EXPORT_SYMBOL_GPL(ad1980_dai);

View File

@@ -282,14 +282,14 @@ struct snd_soc_dai wm9705_dai[] = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM9705_AC97_RATES, .rates = WM9705_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SND_SOC_STD_AC97_FMTS,
}, },
.capture = { .capture = {
.stream_name = "HiFi Capture", .stream_name = "HiFi Capture",
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM9705_AC97_RATES, .rates = WM9705_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SND_SOC_STD_AC97_FMTS,
}, },
.ops = &wm9705_dai_ops, .ops = &wm9705_dai_ops,
}, },

View File

@@ -534,13 +534,13 @@ struct snd_soc_dai wm9712_dai[] = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM9712_AC97_RATES, .rates = WM9712_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.capture = { .capture = {
.stream_name = "HiFi Capture", .stream_name = "HiFi Capture",
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM9712_AC97_RATES, .rates = WM9712_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.ops = &wm9712_dai_ops_hifi, .ops = &wm9712_dai_ops_hifi,
}, },
{ {
@@ -550,7 +550,7 @@ struct snd_soc_dai wm9712_dai[] = {
.channels_min = 1, .channels_min = 1,
.channels_max = 1, .channels_max = 1,
.rates = WM9712_AC97_RATES, .rates = WM9712_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.ops = &wm9712_dai_ops_aux, .ops = &wm9712_dai_ops_aux,
} }
}; };

View File

@@ -1040,13 +1040,13 @@ struct snd_soc_dai wm9713_dai[] = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM9713_RATES, .rates = WM9713_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.capture = { .capture = {
.stream_name = "HiFi Capture", .stream_name = "HiFi Capture",
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM9713_RATES, .rates = WM9713_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.ops = &wm9713_dai_ops_hifi, .ops = &wm9713_dai_ops_hifi,
}, },
{ {
@@ -1056,7 +1056,7 @@ struct snd_soc_dai wm9713_dai[] = {
.channels_min = 1, .channels_min = 1,
.channels_max = 1, .channels_max = 1,
.rates = WM9713_RATES, .rates = WM9713_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SND_SOC_STD_AC97_FMTS,},
.ops = &wm9713_dai_ops_aux, .ops = &wm9713_dai_ops_aux,
}, },
{ {