aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-04-21 11:04:08 -0400
committerTakashi Iwai <tiwai@suse.de>2010-04-22 10:53:10 -0400
commit715aa675338ce6e1a3b4f77cf87ea611f93058a8 (patch)
tree701c97b2fb3dd14d85dc1879b5f881e342febb00 /sound/pci/maestro3.c
parent7efbfd1ae98ef9efe06352e2a1ad83e8c14ceeb1 (diff)
ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume
Ignore spurious HV interrupts during suspend / resume, this avoids mistaking them for a mute button press. This is not very pretty but it seems the only way to fix the master volume control gets muted after suspend issue I'm seeing. Note that the es1968 driver is doing exactly the same. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 728de232e091..b56e33676780 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -849,6 +849,7 @@ struct snd_m3 {
849 struct snd_kcontrol *master_switch; 849 struct snd_kcontrol *master_switch;
850 struct snd_kcontrol *master_volume; 850 struct snd_kcontrol *master_volume;
851 struct tasklet_struct hwvol_tq; 851 struct tasklet_struct hwvol_tq;
852 unsigned int in_suspend;
852 853
853#ifdef CONFIG_PM 854#ifdef CONFIG_PM
854 u16 *suspend_mem; 855 u16 *suspend_mem;
@@ -1614,6 +1615,11 @@ static void snd_m3_update_hw_volume(unsigned long private_data)
1614 outb(0x88, chip->iobase + SHADOW_MIX_REG_MASTER); 1615 outb(0x88, chip->iobase + SHADOW_MIX_REG_MASTER);
1615 outb(0x88, chip->iobase + HW_VOL_COUNTER_MASTER); 1616 outb(0x88, chip->iobase + HW_VOL_COUNTER_MASTER);
1616 1617
1618 /* Ignore spurious HV interrupts during suspend / resume, this avoids
1619 mistaking them for a mute button press. */
1620 if (chip->in_suspend)
1621 return;
1622
1617 if (!chip->master_switch || !chip->master_volume) 1623 if (!chip->master_switch || !chip->master_volume)
1618 return; 1624 return;
1619 1625
@@ -2425,6 +2431,7 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2425 if (chip->suspend_mem == NULL) 2431 if (chip->suspend_mem == NULL)
2426 return 0; 2432 return 0;
2427 2433
2434 chip->in_suspend = 1;
2428 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 2435 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
2429 snd_pcm_suspend_all(chip->pcm); 2436 snd_pcm_suspend_all(chip->pcm);
2430 snd_ac97_suspend(chip->ac97); 2437 snd_ac97_suspend(chip->ac97);
@@ -2498,6 +2505,7 @@ static int m3_resume(struct pci_dev *pci)
2498 snd_m3_hv_init(chip); 2505 snd_m3_hv_init(chip);
2499 2506
2500 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2507 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
2508 chip->in_suspend = 0;
2501 return 0; 2509 return 0;
2502} 2510}
2503#endif /* CONFIG_PM */ 2511#endif /* CONFIG_PM */