]>
Commit | Line | Data |
---|---|---|
3b30ebe5 GKH |
1 | From 715aa675338ce6e1a3b4f77cf87ea611f93058a8 Mon Sep 17 00:00:00 2001 |
2 | From: Hans de Goede <hdegoede@redhat.com> | |
3 | Date: Wed, 21 Apr 2010 11:04:08 -0400 | |
4 | Subject: ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume | |
5 | ||
6 | From: Hans de Goede <hdegoede@redhat.com> | |
7 | ||
8 | commit 715aa675338ce6e1a3b4f77cf87ea611f93058a8 upstream. | |
9 | ||
10 | Ignore spurious HV interrupts during suspend / resume, this avoids | |
11 | mistaking them for a mute button press. This is not very pretty but | |
12 | it seems the only way to fix the master volume control gets muted | |
13 | after suspend issue I'm seeing. Note that the es1968 driver is doing | |
14 | exactly the same. | |
15 | ||
16 | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | |
17 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
19 | ||
20 | --- | |
21 | sound/pci/maestro3.c | 8 ++++++++ | |
22 | 1 file changed, 8 insertions(+) | |
23 | ||
24 | --- a/sound/pci/maestro3.c | |
25 | +++ b/sound/pci/maestro3.c | |
26 | @@ -849,6 +849,7 @@ struct snd_m3 { | |
27 | struct snd_kcontrol *master_switch; | |
28 | struct snd_kcontrol *master_volume; | |
29 | struct tasklet_struct hwvol_tq; | |
30 | + unsigned int in_suspend; | |
31 | ||
32 | #ifdef CONFIG_PM | |
33 | u16 *suspend_mem; | |
34 | @@ -1614,6 +1615,11 @@ static void snd_m3_update_hw_volume(unsi | |
35 | outb(0x88, chip->iobase + SHADOW_MIX_REG_MASTER); | |
36 | outb(0x88, chip->iobase + HW_VOL_COUNTER_MASTER); | |
37 | ||
38 | + /* Ignore spurious HV interrupts during suspend / resume, this avoids | |
39 | + mistaking them for a mute button press. */ | |
40 | + if (chip->in_suspend) | |
41 | + return; | |
42 | + | |
43 | if (!chip->master_switch || !chip->master_volume) | |
44 | return; | |
45 | ||
46 | @@ -2425,6 +2431,7 @@ static int m3_suspend(struct pci_dev *pc | |
47 | if (chip->suspend_mem == NULL) | |
48 | return 0; | |
49 | ||
50 | + chip->in_suspend = 1; | |
51 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | |
52 | snd_pcm_suspend_all(chip->pcm); | |
53 | snd_ac97_suspend(chip->ac97); | |
54 | @@ -2498,6 +2505,7 @@ static int m3_resume(struct pci_dev *pci | |
55 | snd_m3_hv_init(chip); | |
56 | ||
57 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | |
58 | + chip->in_suspend = 0; | |
59 | return 0; | |
60 | } | |
61 | #endif /* CONFIG_PM */ |