diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-02-09 05:45:20 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:28:34 -0500 |
commit | 50dabc2d1139ba01362418874152aeeb591a4544 (patch) | |
tree | 8ade72febf95b39a69579db2ee7e7e066506990c /sound/pci/ac97/ac97_codec.c | |
parent | b2b8229dde970b95e407d90a140e8a8753e1f0f6 (diff) |
[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 <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ac97/ac97_codec.c')
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 6108cdc5efb6..124c1bc4cb92 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 | |||
1030 | unsigned char max[3] = { 63, 31, 15 }; | 1030 | unsigned char max[3] = { 63, 31, 15 }; |
1031 | int i; | 1031 | int i; |
1032 | 1032 | ||
1033 | /* first look up the static resolution table */ | ||
1034 | if (ac97->res_table) { | ||
1035 | const struct snd_ac97_res_table *tbl; | ||
1036 | for (tbl = ac97->res_table; tbl->reg; tbl++) { | ||
1037 | if (tbl->reg == reg) { | ||
1038 | *lo_max = tbl->bits & 0xff; | ||
1039 | *hi_max = (tbl->bits >> 8) & 0xff; | ||
1040 | return; | ||
1041 | } | ||
1042 | } | ||
1043 | } | ||
1044 | |||
1033 | *lo_max = *hi_max = 0; | 1045 | *lo_max = *hi_max = 0; |
1034 | for (i = 0 ; i < ARRAY_SIZE(cbit); i++) { | 1046 | for (i = 0 ; i < ARRAY_SIZE(cbit); i++) { |
1035 | unsigned short val; | 1047 | unsigned short val; |