From 50dabc2d1139ba01362418874152aeeb591a4544 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 9 Feb 2006 11:45:20 +0100 Subject: [ALSA] ac97 - Add support of static resolution tables Modules: AC97 Codec Added the support of static resolution table support for codecs that the driver cannot probe the volume resolution properly. The table pointer should be set in each codec patch. Signed-off-by: Takashi Iwai --- sound/pci/ac97/ac97_codec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sound/pci/ac97') diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 6108cdc5efb..124c1bc4cb9 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -1030,6 +1030,18 @@ static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned cha unsigned char max[3] = { 63, 31, 15 }; int i; + /* first look up the static resolution table */ + if (ac97->res_table) { + const struct snd_ac97_res_table *tbl; + for (tbl = ac97->res_table; tbl->reg; tbl++) { + if (tbl->reg == reg) { + *lo_max = tbl->bits & 0xff; + *hi_max = (tbl->bits >> 8) & 0xff; + return; + } + } + } + *lo_max = *hi_max = 0; for (i = 0 ; i < ARRAY_SIZE(cbit); i++) { unsigned short val; -- cgit v1.2.3