aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront/wavefront.c
diff options
context:
space:
mode:
authorRene Herman <rene.herman@gmail.com>2007-11-30 11:59:25 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:30 -0500
commit109c53f840e551d6e99ecfd8b0131a968332c89f (patch)
tree212af8d6ebb3303a21dd44b032fd5949fdc37607 /sound/isa/wavefront/wavefront.c
parentdf1deb67532ea26f1a033a5f48bf34b30bec8e1d (diff)
[ALSA] sound/isa: kill pnp_resource_change
This removes the pnp_resource_change use from the ALSA ISAPnP drivers. In 2.4 these were useful in providing an easy path to setting the resources, but in 2.6 they retain function as a layering violation only. This makes for a nice cleanup (-550 lines) of ALSA but moreover, ALSA is the only remaining user of pnp_init_resource_table(), pnp_resource_change() and pnp_manual_config_dev() (and, in fact, of 'struct pnp_resource_table') in the tree outide of drivers/pnp itself meaning it makes for more cleanup potential inside the PnP layer. Thomas Renninger acked their removal from that side, you did from the ALSA side (CC list just copied from that thread). Against current alsa-kernel HG. Many more potential cleanups in there, but this _only_ removes the pnp_resource_change code. Compile tested against current alsa-kernel HG and compile- and use-tested against 2.6.23.x (few offsets). Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Rene Herman <rene.herman@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/isa/wavefront/wavefront.c')
-rw-r--r--sound/isa/wavefront/wavefront.c55
1 files changed, 3 insertions, 52 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 83c2fc4cfc64..15c604653428 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -104,21 +104,15 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c
104 const struct pnp_card_device_id *id) 104 const struct pnp_card_device_id *id)
105{ 105{
106 struct pnp_dev *pdev; 106 struct pnp_dev *pdev;
107 struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
108 int err; 107 int err;
109 108
110 if (!cfg)
111 return -ENOMEM;
112
113 /* Check for each logical device. */ 109 /* Check for each logical device. */
114 110
115 /* CS4232 chip (aka "windows sound system") is logical device 0 */ 111 /* CS4232 chip (aka "windows sound system") is logical device 0 */
116 112
117 acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL); 113 acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL);
118 if (acard->wss == NULL) { 114 if (acard->wss == NULL)
119 kfree(cfg);
120 return -EBUSY; 115 return -EBUSY;
121 }
122 116
123 /* there is a game port at logical device 1, but we ignore it completely */ 117 /* there is a game port at logical device 1, but we ignore it completely */
124 118
@@ -133,26 +127,20 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c
133 127
134 if (use_cs4232_midi[dev]) { 128 if (use_cs4232_midi[dev]) {
135 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL); 129 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
136 if (acard->mpu == NULL) { 130 if (acard->mpu == NULL)
137 kfree(cfg);
138 return -EBUSY; 131 return -EBUSY;
139 }
140 } 132 }
141 133
142 /* The ICS2115 synth is logical device 4 */ 134 /* The ICS2115 synth is logical device 4 */
143 135
144 acard->synth = pnp_request_card_device(card, id->devs[3].id, NULL); 136 acard->synth = pnp_request_card_device(card, id->devs[3].id, NULL);
145 if (acard->synth == NULL) { 137 if (acard->synth == NULL)
146 kfree(cfg);
147 return -EBUSY; 138 return -EBUSY;
148 }
149 139
150 /* PCM/FM initialization */ 140 /* PCM/FM initialization */
151 141
152 pdev = acard->wss; 142 pdev = acard->wss;
153 143
154 pnp_init_resource_table(cfg);
155
156 /* An interesting note from the Tropez+ FAQ: 144 /* An interesting note from the Tropez+ FAQ:
157 145
158 Q. [Ports] Why is the base address of the WSS I/O ports off by 4? 146 Q. [Ports] Why is the base address of the WSS I/O ports off by 4?
@@ -165,23 +153,9 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c
165 153
166 */ 154 */
167 155
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); 156 err = pnp_activate_dev(pdev);
182 if (err < 0) { 157 if (err < 0) {
183 snd_printk(KERN_ERR "PnP WSS pnp configure failure\n"); 158 snd_printk(KERN_ERR "PnP WSS pnp configure failure\n");
184 kfree(cfg);
185 return err; 159 return err;
186 } 160 }
187 161
@@ -195,22 +169,9 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c
195 169
196 pdev = acard->synth; 170 pdev = acard->synth;
197 171
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); 172 err = pnp_activate_dev(pdev);
211 if (err < 0) { 173 if (err < 0) {
212 snd_printk(KERN_ERR "PnP ICS2115 pnp configure failure\n"); 174 snd_printk(KERN_ERR "PnP ICS2115 pnp configure failure\n");
213 kfree(cfg);
214 return err; 175 return err;
215 } 176 }
216 177
@@ -226,15 +187,6 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c
226 187
227 pdev = acard->mpu; 188 pdev = acard->mpu;
228 189
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); 190 err = pnp_activate_dev(pdev);
239 if (err < 0) { 191 if (err < 0) {
240 snd_printk(KERN_ERR "PnP MPU401 pnp configure failure\n"); 192 snd_printk(KERN_ERR "PnP MPU401 pnp configure failure\n");
@@ -258,7 +210,6 @@ snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *c
258 ics2115_port[dev], 210 ics2115_port[dev],
259 ics2115_irq[dev]); 211 ics2115_irq[dev]);
260 212
261 kfree(cfg);
262 return 0; 213 return 0;
263} 214}
264 215