diff options
Diffstat (limited to 'sound/pci/oxygen/oxygen_mixer.c')
-rw-r--r-- | sound/pci/oxygen/oxygen_mixer.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 26c7e8bcb229..c0dbb52d45be 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -618,9 +618,12 @@ static int ac97_volume_get(struct snd_kcontrol *ctl, | |||
618 | mutex_lock(&chip->mutex); | 618 | mutex_lock(&chip->mutex); |
619 | reg = oxygen_read_ac97(chip, codec, index); | 619 | reg = oxygen_read_ac97(chip, codec, index); |
620 | mutex_unlock(&chip->mutex); | 620 | mutex_unlock(&chip->mutex); |
621 | value->value.integer.value[0] = 31 - (reg & 0x1f); | 621 | if (!stereo) { |
622 | if (stereo) | 622 | value->value.integer.value[0] = 31 - (reg & 0x1f); |
623 | value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f); | 623 | } else { |
624 | value->value.integer.value[0] = 31 - ((reg >> 8) & 0x1f); | ||
625 | value->value.integer.value[1] = 31 - (reg & 0x1f); | ||
626 | } | ||
624 | return 0; | 627 | return 0; |
625 | } | 628 | } |
626 | 629 | ||
@@ -636,14 +639,14 @@ static int ac97_volume_put(struct snd_kcontrol *ctl, | |||
636 | 639 | ||
637 | mutex_lock(&chip->mutex); | 640 | mutex_lock(&chip->mutex); |
638 | oldreg = oxygen_read_ac97(chip, codec, index); | 641 | oldreg = oxygen_read_ac97(chip, codec, index); |
639 | newreg = oldreg; | 642 | if (!stereo) { |
640 | newreg = (newreg & ~0x1f) | | 643 | newreg = oldreg & ~0x1f; |
641 | (31 - (value->value.integer.value[0] & 0x1f)); | 644 | newreg |= 31 - (value->value.integer.value[0] & 0x1f); |
642 | if (stereo) | 645 | } else { |
643 | newreg = (newreg & ~0x1f00) | | 646 | newreg = oldreg & ~0x1f1f; |
644 | ((31 - (value->value.integer.value[1] & 0x1f)) << 8); | 647 | newreg |= (31 - (value->value.integer.value[0] & 0x1f)) << 8; |
645 | else | 648 | newreg |= 31 - (value->value.integer.value[1] & 0x1f); |
646 | newreg = (newreg & ~0x1f00) | ((newreg & 0x1f) << 8); | 649 | } |
647 | change = newreg != oldreg; | 650 | change = newreg != oldreg; |
648 | if (change) | 651 | if (change) |
649 | oxygen_write_ac97(chip, codec, index, newreg); | 652 | oxygen_write_ac97(chip, codec, index, newreg); |