aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/ac97.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index dd1a9f579a6b..55bc55eb6e24 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -26,22 +26,7 @@
26#include <sound/initval.h> 26#include <sound/initval.h>
27#include <sound/soc.h> 27#include <sound/soc.h>
28 28
29#define AC97_VERSION "0.5" 29#define AC97_VERSION "0.6"
30
31#define AC97_DIR \
32 (SND_SOC_DAIDIR_PLAYBACK | SND_SOC_DAIDIR_CAPTURE)
33
34#define AC97_RATES \
35 (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
36 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
37 SNDRV_PCM_RATE_48000)
38
39/* may need to expand this */
40static struct snd_soc_dai_mode soc_ac97[] = {
41 {0, 0, SNDRV_PCM_FMTBIT_S16_LE, AC97_RATES},
42 {0, 0, SNDRV_PCM_FMTBIT_S18_3LE, AC97_RATES},
43 {0, 0, SNDRV_PCM_FMTBIT_S20_3LE, AC97_RATES},
44};
45 30
46static int ac97_prepare(struct snd_pcm_substream *substream) 31static int ac97_prepare(struct snd_pcm_substream *substream)
47{ 32{
@@ -55,21 +40,25 @@ static int ac97_prepare(struct snd_pcm_substream *substream)
55 return snd_ac97_set_rate(codec->ac97, reg, runtime->rate); 40 return snd_ac97_set_rate(codec->ac97, reg, runtime->rate);
56} 41}
57 42
43#define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
44 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
45
58static struct snd_soc_codec_dai ac97_dai = { 46static struct snd_soc_codec_dai ac97_dai = {
59 .name = "AC97 HiFi", 47 .name = "AC97 HiFi",
60 .playback = { 48 .playback = {
61 .stream_name = "AC97 Playback", 49 .stream_name = "AC97 Playback",
62 .channels_min = 1, 50 .channels_min = 1,
63 .channels_max = 2,}, 51 .channels_max = 2,
52 .rates = STD_AC97_RATES,
53 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
64 .capture = { 54 .capture = {
65 .stream_name = "AC97 Capture", 55 .stream_name = "AC97 Capture",
66 .channels_min = 1, 56 .channels_min = 1,
67 .channels_max = 2,}, 57 .channels_max = 2,
58 .rates = STD_AC97_RATES,
59 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
68 .ops = { 60 .ops = {
69 .prepare = ac97_prepare,}, 61 .prepare = ac97_prepare,},
70 .caps = {
71 .num_modes = ARRAY_SIZE(soc_ac97),
72 .mode = soc_ac97,},
73}; 62};
74 63
75static unsigned int ac97_read(struct snd_soc_codec *codec, 64static unsigned int ac97_read(struct snd_soc_codec *codec,