From df8baadafc6359c58dba52543de5a34055c1c99c Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 2 Feb 2007 17:16:41 +0100 Subject: [PATCH] --- yaml --- r: 47215 b: refs/heads/master c: 5a8ec343c5ba1e78ba23bebd9ad4b23f39c50828 h: refs/heads/master i: 47213: 78c6343298cbc0c336bf0730bd6b8c89be6fa12c 47211: d85368a145b127f488c5d95f98c2049615d50a26 47207: 75e759bfb0235fd10df891ffc02cf6b4b1efa8f2 47199: 257c1c3e6a5d9d6c1e8e56c4596d707363885e61 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/ac97.c | 31 ++++++++++--------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/[refs] b/[refs] index dabe45d655cc..7ac15abf50a6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cbe83b1795feea33803dc89fce18b2b98abbcc9b +refs/heads/master: 5a8ec343c5ba1e78ba23bebd9ad4b23f39c50828 diff --git a/trunk/sound/soc/codecs/ac97.c b/trunk/sound/soc/codecs/ac97.c index dd1a9f579a6b..55bc55eb6e24 100644 --- a/trunk/sound/soc/codecs/ac97.c +++ b/trunk/sound/soc/codecs/ac97.c @@ -26,22 +26,7 @@ #include #include -#define AC97_VERSION "0.5" - -#define AC97_DIR \ - (SND_SOC_DAIDIR_PLAYBACK | SND_SOC_DAIDIR_CAPTURE) - -#define AC97_RATES \ - (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \ - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ - SNDRV_PCM_RATE_48000) - -/* may need to expand this */ -static struct snd_soc_dai_mode soc_ac97[] = { - {0, 0, SNDRV_PCM_FMTBIT_S16_LE, AC97_RATES}, - {0, 0, SNDRV_PCM_FMTBIT_S18_3LE, AC97_RATES}, - {0, 0, SNDRV_PCM_FMTBIT_S20_3LE, AC97_RATES}, -}; +#define AC97_VERSION "0.6" static int ac97_prepare(struct snd_pcm_substream *substream) { @@ -55,21 +40,25 @@ static int ac97_prepare(struct snd_pcm_substream *substream) return snd_ac97_set_rate(codec->ac97, reg, runtime->rate); } +#define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ + SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) + static struct snd_soc_codec_dai ac97_dai = { .name = "AC97 HiFi", .playback = { .stream_name = "AC97 Playback", .channels_min = 1, - .channels_max = 2,}, + .channels_max = 2, + .rates = STD_AC97_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, .capture = { .stream_name = "AC97 Capture", .channels_min = 1, - .channels_max = 2,}, + .channels_max = 2, + .rates = STD_AC97_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, .ops = { .prepare = ac97_prepare,}, - .caps = { - .num_modes = ARRAY_SIZE(soc_ac97), - .mode = soc_ac97,}, }; static unsigned int ac97_read(struct snd_soc_codec *codec,