summaryrefslogtreecommitdiff
path: root/sound/pci/es1968.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-23 17:21:12 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-23 17:21:12 -0700
commitf7425b160db500520c33f241edb066fc5c413f03 (patch)
treef1f50b935fa49a273f8df685b5fb2fcf6a0f07a6 /sound/pci/es1968.c
parent9f261e011340bcd22c1dd48b465153bd78caa8c8 (diff)
parentf0063c4489a00ed5395378ef80a7edea4272f20b (diff)
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (148 commits) [ALSA] intel8x0m - Free irq in suspend [ALSA] Move CONFIG_SND_AC97_POWER_SAVE to pci/Kconfig [ALSA] usb-audio: add mixer control names for the Aureon 5.1 MkII [ALSA] ES1938: remove duplicate field initialization [ALSA] usb-audio: increase number of packets per URB [ALSA] hda-codec - Fix headphone auto-toggle on sigmatel codec [ALSA] hda-intel - A slight cleanup of timeout check in azx_get_response() [ALSA] hda-codec - Fix mic input with STAC92xx codecs [ALSA] mixart: Use SEEK_{SET,CUR,END} instead of hardcoded values [ALSA] gus: Use SEEK_{SET,CUR,END} instead of hardcoded values [ALSA] opl4: Use SEEK_{SET,CUR,END} instead of hardcoded values [ALSA] sound core: Use SEEK_{SET,CUR,END} instead of hardcoded values [ALSA] hda-codec - Support multiple headphone pins [ALSA] hda_intel prefer 24bit instead of 20bit [ALSA] hda-codec - Add vendor ids for Motorola and Conexant [ALSA] hda-codec - Add device id for Motorola si3054-compatible codec [ALSA] Add missing compat ioctls for ALSA control API [ALSA] powermac - Fix Oops when conflicting with aoa driver [ALSA] aoa: add locking to tas codec [ALSA] hda-intel - Fix suspend/resume with MSI ...
Diffstat (limited to 'sound/pci/es1968.c')
-rw-r--r--sound/pci/es1968.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 3c5ab7c2e72d..f3c40385c87d 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -1905,7 +1905,7 @@ static void es1968_update_hw_volume(unsigned long private_data)
/* Figure out which volume control button was pushed,
based on differences from the default register
values. */
- x = inb(chip->io_port + 0x1c);
+ x = inb(chip->io_port + 0x1c) & 0xee;
/* Reset the volume control registers. */
outb(0x88, chip->io_port + 0x1c);
outb(0x88, chip->io_port + 0x1d);
@@ -1921,7 +1921,8 @@ static void es1968_update_hw_volume(unsigned long private_data)
/* FIXME: we can't call snd_ac97_* functions since here is in tasklet. */
spin_lock_irqsave(&chip->ac97_lock, flags);
val = chip->ac97->regs[AC97_MASTER];
- if (x & 1) {
+ switch (x) {
+ case 0x88:
/* mute */
val ^= 0x8000;
chip->ac97->regs[AC97_MASTER] = val;
@@ -1929,26 +1930,31 @@ static void es1968_update_hw_volume(unsigned long private_data)
outb(AC97_MASTER, chip->io_port + ESM_AC97_INDEX);
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&chip->master_switch->id);
- } else {
- val &= 0x7fff;
- if (((x>>1) & 7) > 4) {
- /* volume up */
- if ((val & 0xff) > 0)
- val--;
- if ((val & 0xff00) > 0)
- val -= 0x0100;
- } else {
- /* volume down */
- if ((val & 0xff) < 0x1f)
- val++;
- if ((val & 0xff00) < 0x1f00)
- val += 0x0100;
- }
+ break;
+ case 0xaa:
+ /* volume up */
+ if ((val & 0x7f) > 0)
+ val--;
+ if ((val & 0x7f00) > 0)
+ val -= 0x0100;
+ chip->ac97->regs[AC97_MASTER] = val;
+ outw(val, chip->io_port + ESM_AC97_DATA);
+ outb(AC97_MASTER, chip->io_port + ESM_AC97_INDEX);
+ snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
+ &chip->master_volume->id);
+ break;
+ case 0x66:
+ /* volume down */
+ if ((val & 0x7f) < 0x1f)
+ val++;
+ if ((val & 0x7f00) < 0x1f00)
+ val += 0x0100;
chip->ac97->regs[AC97_MASTER] = val;
outw(val, chip->io_port + ESM_AC97_DATA);
outb(AC97_MASTER, chip->io_port + ESM_AC97_INDEX);
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&chip->master_volume->id);
+ break;
}
spin_unlock_irqrestore(&chip->ac97_lock, flags);
}