/[linux-patches]/genpatches-2.6/tags/2.6.14-6/1054_4_nm256-reset-workaround.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.14-6/1054_4_nm256-reset-workaround.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 233 - (show annotations) (download)
Thu Dec 15 16:43:31 2005 UTC (13 years ago) by dsd
File size: 4459 byte(s)
2.6.14-6 release
1 From stable-bounces@linux.kernel.org Tue Dec 6 18:56:50 2005
2 Date: Tue, 6 Dec 2005 21:51:53 -0500
3 From: Dave Jones <davej@redhat.com>
4 To: stable@kernel.org
5 Message-ID: <20051207025153.GA22374@redhat.com>
6 Content-Disposition: inline
7 Cc:
8 Subject: ALSA: nm256: reset workaround for Latitude CSx
9
10 From: John W. Linville <linville@tuxdriver.com>
11
12 Modules: NM256 driver
13
14 The current snd-nm256 driver can cause Dell Latitude CSx laptops to
15 lock-up during module (un)load. I have isolated this to the writes to
16 the control port register at offset 0x6cc which were not already
17 protected by the existing reset_workaround.
18
19 I tried grouping these writes with the existing reset_workaround
20 clause, but that caused the driver to have (un)load problems on the
21 Dell Latitude LS laptops. So, I have implemented a reset_workaround_2
22 clause (please feel free to suggest a better name!) to cover this
23 situation and added a quirk entry for the CSx laptops.
24
25 Signed-off-by: John W. Linville <linville@tuxdriver.com>
26 Signed-off-by: Takashi Iwai <tiwai@suse.de>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
28
29
30 ---
31 sound/pci/nm256/nm256.c | 23 ++++++++++++++++++++---
32 1 file changed, 20 insertions(+), 3 deletions(-)
33
34 --- linux-2.6.14.3.orig/sound/pci/nm256/nm256.c
35 +++ linux-2.6.14.3/sound/pci/nm256/nm256.c
36 @@ -62,6 +62,7 @@ static int buffer_top[SNDRV_CARDS] = {[0
37 static int use_cache[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */
38 static int vaio_hack[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */
39 static int reset_workaround[SNDRV_CARDS];
40 +static int reset_workaround_2[SNDRV_CARDS];
41
42 module_param_array(index, int, NULL, 0444);
43 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
44 @@ -83,6 +84,8 @@ module_param_array(vaio_hack, bool, NULL
45 MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks.");
46 module_param_array(reset_workaround, bool, NULL, 0444);
47 MODULE_PARM_DESC(reset_workaround, "Enable AC97 RESET workaround for some laptops.");
48 +module_param_array(reset_workaround_2, bool, NULL, 0444);
49 +MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops.");
50
51 /*
52 * hw definitions
53 @@ -226,6 +229,7 @@ struct snd_nm256 {
54 unsigned int coeffs_current: 1; /* coeff. table is loaded? */
55 unsigned int use_cache: 1; /* use one big coef. table */
56 unsigned int reset_workaround: 1; /* Workaround for some laptops to avoid freeze */
57 + unsigned int reset_workaround_2: 1; /* Extended workaround for some other laptops to avoid freeze */
58
59 int mixer_base; /* register offset of ac97 mixer */
60 int mixer_status_offset; /* offset of mixer status reg. */
61 @@ -1199,8 +1203,11 @@ snd_nm256_ac97_reset(ac97_t *ac97)
62 /* Dell latitude LS will lock up by this */
63 snd_nm256_writeb(chip, 0x6cc, 0x87);
64 }
65 - snd_nm256_writeb(chip, 0x6cc, 0x80);
66 - snd_nm256_writeb(chip, 0x6cc, 0x0);
67 + if (! chip->reset_workaround_2) {
68 + /* Dell latitude CSx will lock up by this */
69 + snd_nm256_writeb(chip, 0x6cc, 0x80);
70 + snd_nm256_writeb(chip, 0x6cc, 0x0);
71 + }
72 }
73
74 /* create an ac97 mixer interface */
75 @@ -1542,7 +1549,7 @@ struct nm256_quirk {
76 int type;
77 };
78
79 -enum { NM_BLACKLISTED, NM_RESET_WORKAROUND };
80 +enum { NM_BLACKLISTED, NM_RESET_WORKAROUND, NM_RESET_WORKAROUND_2 };
81
82 static struct nm256_quirk nm256_quirks[] __devinitdata = {
83 /* HP omnibook 4150 has cs4232 codec internally */
84 @@ -1551,6 +1558,8 @@ static struct nm256_quirk nm256_quirks[]
85 { .vendor = 0x104d, .device = 0x8041, .type = NM_RESET_WORKAROUND },
86 /* Dell Latitude LS */
87 { .vendor = 0x1028, .device = 0x0080, .type = NM_RESET_WORKAROUND },
88 + /* Dell Latitude CSx */
89 + { .vendor = 0x1028, .device = 0x0091, .type = NM_RESET_WORKAROUND_2 },
90 { } /* terminator */
91 };
92
93 @@ -1582,6 +1591,9 @@ static int __devinit snd_nm256_probe(str
94 case NM_BLACKLISTED:
95 printk(KERN_INFO "nm256: The device is blacklisted. Loading stopped\n");
96 return -ENODEV;
97 + case NM_RESET_WORKAROUND_2:
98 + reset_workaround_2[dev] = 1;
99 + /* Fall-through */
100 case NM_RESET_WORKAROUND:
101 reset_workaround[dev] = 1;
102 break;
103 @@ -1638,6 +1650,11 @@ static int __devinit snd_nm256_probe(str
104 chip->reset_workaround = 1;
105 }
106
107 + if (reset_workaround_2[dev]) {
108 + snd_printdd(KERN_INFO "nm256: reset_workaround_2 activated\n");
109 + chip->reset_workaround_2 = 1;
110 + }
111 +
112 if ((err = snd_nm256_pcm(chip, 0)) < 0 ||
113 (err = snd_nm256_mixer(chip)) < 0) {
114 snd_card_free(card);

  ViewVC Help
Powered by ViewVC 1.1.20