diff options
Diffstat (limited to 'sound/isa/wavefront/wavefront.c')
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 83c2fc4cfc64..3a6c6fe1ec4d 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -19,7 +19,6 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <sound/driver.h> | ||
23 | #include <linux/init.h> | 22 | #include <linux/init.h> |
24 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
25 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
@@ -104,21 +103,15 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c | |||
104 | const struct pnp_card_device_id *id) | 103 | const struct pnp_card_device_id *id) |
105 | { | 104 | { |
106 | struct pnp_dev *pdev; | 105 | struct pnp_dev *pdev; |
107 | struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); | ||
108 | int err; | 106 | int err; |
109 | 107 | ||
110 | if (!cfg) | ||
111 | return -ENOMEM; | ||
112 | |||
113 | /* Check for each logical device. */ | 108 | /* Check for each logical device. */ |
114 | 109 | ||
115 | /* CS4232 chip (aka "windows sound system") is logical device 0 */ | 110 | /* CS4232 chip (aka "windows sound system") is logical device 0 */ |
116 | 111 | ||
117 | acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL); | 112 | acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL); |
118 | if (acard->wss == NULL) { | 113 | if (acard->wss == NULL) |
119 | kfree(cfg); | ||
120 | return -EBUSY; | 114 | return -EBUSY; |
121 | } | ||
122 | 115 | ||
123 | /* there is a game port at logical device 1, but we ignore it completely */ | 116 | /* there is a game port at logical device 1, but we ignore it completely */ |
124 | 117 | ||
@@ -133,26 +126,20 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c | |||
133 | 126 | ||
134 | if (use_cs4232_midi[dev]) { | 127 | if (use_cs4232_midi[dev]) { |
135 | acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL); | 128 | acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL); |
136 | if (acard->mpu == NULL) { | 129 | if (acard->mpu == NULL) |
137 | kfree(cfg); | ||
138 | return -EBUSY; | 130 | return -EBUSY; |
139 | } | ||
140 | } | 131 | } |
141 | 132 | ||
142 | /* The ICS2115 synth is logical device 4 */ | 133 | /* The ICS2115 synth is logical device 4 */ |
143 | 134 | ||
144 | acard->synth = pnp_request_card_device(card, id->devs[3].id, NULL); | 135 | acard->synth = pnp_request_card_device(card, id->devs[3].id, NULL); |
145 | if (acard->synth == NULL) { | 136 | if (acard->synth == NULL) |
146 | kfree(cfg); | ||
147 | return -EBUSY; | 137 | return -EBUSY; |
148 | } | ||
149 | 138 | ||
150 | /* PCM/FM initialization */ | 139 | /* PCM/FM initialization */ |
151 | 140 | ||
152 | pdev = acard->wss; | 141 | pdev = acard->wss; |
153 | 142 | ||
154 | pnp_init_resource_table(cfg); | ||
155 | |||
156 | /* An interesting note from the Tropez+ FAQ: | 143 | /* An interesting note from the Tropez+ FAQ: |
157 | 144 | ||
158 | Q. [Ports] Why is the base address of the WSS I/O ports off by 4? | 145 | Q. [Ports] Why is the base address of the WSS I/O ports off by 4? |
@@ -165,23 +152,9 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c | |||
165 | 152 | ||
166 | */ | 153 | */ |
167 | 154 | ||
168 | if (cs4232_pcm_port[dev] != SNDRV_AUTO_PORT) | ||
169 | pnp_resource_change(&cfg->port_resource[0], cs4232_pcm_port[dev], 4); | ||
170 | if (fm_port[dev] != SNDRV_AUTO_PORT) | ||
171 | pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4); | ||
172 | if (dma1[dev] != SNDRV_AUTO_DMA) | ||
173 | pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1); | ||
174 | if (dma2[dev] != SNDRV_AUTO_DMA) | ||
175 | pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1); | ||
176 | if (cs4232_pcm_irq[dev] != SNDRV_AUTO_IRQ) | ||
177 | pnp_resource_change(&cfg->irq_resource[0], cs4232_pcm_irq[dev], 1); | ||
178 | |||
179 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
180 | snd_printk(KERN_ERR "PnP WSS the requested resources are invalid, using auto config\n"); | ||
181 | err = pnp_activate_dev(pdev); | 155 | err = pnp_activate_dev(pdev); |
182 | if (err < 0) { | 156 | if (err < 0) { |
183 | snd_printk(KERN_ERR "PnP WSS pnp configure failure\n"); | 157 | snd_printk(KERN_ERR "PnP WSS pnp configure failure\n"); |
184 | kfree(cfg); | ||
185 | return err; | 158 | return err; |
186 | } | 159 | } |
187 | 160 | ||
@@ -195,22 +168,9 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c | |||
195 | 168 | ||
196 | pdev = acard->synth; | 169 | pdev = acard->synth; |
197 | 170 | ||
198 | pnp_init_resource_table(cfg); | ||
199 | |||
200 | if (ics2115_port[dev] != SNDRV_AUTO_PORT) { | ||
201 | pnp_resource_change(&cfg->port_resource[0], ics2115_port[dev], 16); | ||
202 | } | ||
203 | |||
204 | if (ics2115_port[dev] != SNDRV_AUTO_IRQ) { | ||
205 | pnp_resource_change(&cfg->irq_resource[0], ics2115_irq[dev], 1); | ||
206 | } | ||
207 | |||
208 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
209 | snd_printk(KERN_ERR "PnP ICS2115 the requested resources are invalid, using auto config\n"); | ||
210 | err = pnp_activate_dev(pdev); | 171 | err = pnp_activate_dev(pdev); |
211 | if (err < 0) { | 172 | if (err < 0) { |
212 | snd_printk(KERN_ERR "PnP ICS2115 pnp configure failure\n"); | 173 | snd_printk(KERN_ERR "PnP ICS2115 pnp configure failure\n"); |
213 | kfree(cfg); | ||
214 | return err; | 174 | return err; |
215 | } | 175 | } |
216 | 176 | ||
@@ -226,15 +186,6 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c | |||
226 | 186 | ||
227 | pdev = acard->mpu; | 187 | pdev = acard->mpu; |
228 | 188 | ||
229 | pnp_init_resource_table(cfg); | ||
230 | |||
231 | if (cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) | ||
232 | pnp_resource_change(&cfg->port_resource[0], cs4232_mpu_port[dev], 2); | ||
233 | if (cs4232_mpu_irq[dev] != SNDRV_AUTO_IRQ) | ||
234 | pnp_resource_change(&cfg->port_resource[0], cs4232_mpu_irq[dev], 1); | ||
235 | |||
236 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
237 | snd_printk(KERN_ERR "PnP MPU401 the requested resources are invalid, using auto config\n"); | ||
238 | err = pnp_activate_dev(pdev); | 189 | err = pnp_activate_dev(pdev); |
239 | if (err < 0) { | 190 | if (err < 0) { |
240 | snd_printk(KERN_ERR "PnP MPU401 pnp configure failure\n"); | 191 | snd_printk(KERN_ERR "PnP MPU401 pnp configure failure\n"); |
@@ -258,7 +209,6 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c | |||
258 | ics2115_port[dev], | 209 | ics2115_port[dev], |
259 | ics2115_irq[dev]); | 210 | ics2115_irq[dev]); |
260 | 211 | ||
261 | kfree(cfg); | ||
262 | return 0; | 212 | return 0; |
263 | } | 213 | } |
264 | 214 | ||