diff options
-rw-r--r-- | include/sound/ac97_codec.h | 7 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index ad3fe046f6cf..9036d25e1bac 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -444,6 +444,12 @@ struct snd_ac97_template { | |||
444 | DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ | 444 | DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ |
445 | }; | 445 | }; |
446 | 446 | ||
447 | /* static resolution table */ | ||
448 | struct snd_ac97_res_table { | ||
449 | unsigned short reg; /* register */ | ||
450 | unsigned short bits; /* resolution bitmask */ | ||
451 | }; | ||
452 | |||
447 | struct snd_ac97 { | 453 | struct snd_ac97 { |
448 | /* -- lowlevel (hardware) driver specific -- */ | 454 | /* -- lowlevel (hardware) driver specific -- */ |
449 | struct snd_ac97_build_ops * build_ops; | 455 | struct snd_ac97_build_ops * build_ops; |
@@ -464,6 +470,7 @@ struct snd_ac97 { | |||
464 | unsigned short caps; /* capabilities (register 0) */ | 470 | unsigned short caps; /* capabilities (register 0) */ |
465 | unsigned short ext_id; /* extended feature identification (register 28) */ | 471 | unsigned short ext_id; /* extended feature identification (register 28) */ |
466 | unsigned short ext_mid; /* extended modem ID (register 3C) */ | 472 | unsigned short ext_mid; /* extended modem ID (register 3C) */ |
473 | const struct snd_ac97_res_table *res_table; /* static resolution */ | ||
467 | unsigned int scaps; /* driver capabilities */ | 474 | unsigned int scaps; /* driver capabilities */ |
468 | unsigned int flags; /* specific code */ | 475 | unsigned int flags; /* specific code */ |
469 | unsigned int rates[6]; /* see AC97_RATES_* defines */ | 476 | unsigned int rates[6]; /* see AC97_RATES_* defines */ |
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; |