Commit a2142674 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Fix the detection of resolution of ac97 controls

AC97 Codec
Fixed the detection of bit resolution of ac97 mixer controls.
This will fix the problem with TI ac97 codecs.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 56f5ceed
...@@ -1072,9 +1072,9 @@ static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max ...@@ -1072,9 +1072,9 @@ static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max
unsigned short val; unsigned short val;
snd_ac97_write(ac97, reg, 0x8080 | cbit[i] | (cbit[i] << 8)); snd_ac97_write(ac97, reg, 0x8080 | cbit[i] | (cbit[i] << 8));
val = snd_ac97_read(ac97, reg); val = snd_ac97_read(ac97, reg);
if (! *lo_max && (val & cbit[i])) if (! *lo_max && (val & 0x7f) == cbit[i])
*lo_max = max[i]; *lo_max = max[i];
if (! *hi_max && (val & (cbit[i] << 8))) if (! *hi_max && ((val >> 8) & 0x7f) == cbit[i])
*hi_max = max[i]; *hi_max = max[i];
if (*lo_max && *hi_max) if (*lo_max && *hi_max)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment