提交 2492250e 编写于 作者: C Clemens Ladisch 提交者: Takashi Iwai

ALSA: oxygen, virtuoso: fix exchanged L/R volumes of aux and CD inputs

The driver accidentally exchanged the left/right fields for stereo AC'97
mixer registers.  This affected only the aux and CD inputs because the
line input bypasses the AC'97 codec and the mic input is mono; cards
without AC'97 (Xonar DS/DG/HDAV Slim, HG2PCI, HiFier) were not affected.
Reported-and-tested-by: NAbby Cedar <abbycedar@yahoo.com.au>
Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
Cc: 2.6.31+ <stable@vger.kernel.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 927c9423
...@@ -618,9 +618,12 @@ static int ac97_volume_get(struct snd_kcontrol *ctl, ...@@ -618,9 +618,12 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
mutex_lock(&chip->mutex); mutex_lock(&chip->mutex);
reg = oxygen_read_ac97(chip, codec, index); reg = oxygen_read_ac97(chip, codec, index);
mutex_unlock(&chip->mutex); mutex_unlock(&chip->mutex);
value->value.integer.value[0] = 31 - (reg & 0x1f); if (!stereo) {
if (stereo) value->value.integer.value[0] = 31 - (reg & 0x1f);
value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f); } else {
value->value.integer.value[0] = 31 - ((reg >> 8) & 0x1f);
value->value.integer.value[1] = 31 - (reg & 0x1f);
}
return 0; return 0;
} }
...@@ -636,14 +639,14 @@ static int ac97_volume_put(struct snd_kcontrol *ctl, ...@@ -636,14 +639,14 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
mutex_lock(&chip->mutex); mutex_lock(&chip->mutex);
oldreg = oxygen_read_ac97(chip, codec, index); oldreg = oxygen_read_ac97(chip, codec, index);
newreg = oldreg; if (!stereo) {
newreg = (newreg & ~0x1f) | newreg = oldreg & ~0x1f;
(31 - (value->value.integer.value[0] & 0x1f)); newreg |= 31 - (value->value.integer.value[0] & 0x1f);
if (stereo) } else {
newreg = (newreg & ~0x1f00) | newreg = oldreg & ~0x1f1f;
((31 - (value->value.integer.value[1] & 0x1f)) << 8); newreg |= (31 - (value->value.integer.value[0] & 0x1f)) << 8;
else newreg |= 31 - (value->value.integer.value[1] & 0x1f);
newreg = (newreg & ~0x1f00) | ((newreg & 0x1f) << 8); }
change = newreg != oldreg; change = newreg != oldreg;
if (change) if (change)
oxygen_write_ac97(chip, codec, index, newreg); oxygen_write_ac97(chip, codec, index, newreg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册