diff options
Diffstat (limited to 'sound/isa/cmi8330.c')
-rw-r--r-- | sound/isa/cmi8330.c | 106 |
1 files changed, 67 insertions, 39 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 4d198ec71e9b..e49aec700a55 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <linux/pnp.h> | 50 | #include <linux/pnp.h> |
51 | #include <linux/moduleparam.h> | 51 | #include <linux/moduleparam.h> |
52 | #include <sound/core.h> | 52 | #include <sound/core.h> |
53 | #include <sound/ad1848.h> | 53 | #include <sound/wss.h> |
54 | #include <sound/sb.h> | 54 | #include <sound/sb.h> |
55 | #include <sound/initval.h> | 55 | #include <sound/initval.h> |
56 | 56 | ||
@@ -151,7 +151,7 @@ struct snd_cmi8330 { | |||
151 | struct pnp_dev *play; | 151 | struct pnp_dev *play; |
152 | #endif | 152 | #endif |
153 | struct snd_card *card; | 153 | struct snd_card *card; |
154 | struct snd_ad1848 *wss; | 154 | struct snd_wss *wss; |
155 | struct snd_sb *sb; | 155 | struct snd_sb *sb; |
156 | 156 | ||
157 | struct snd_pcm *pcm; | 157 | struct snd_pcm *pcm; |
@@ -174,32 +174,57 @@ MODULE_DEVICE_TABLE(pnp_card, snd_cmi8330_pnpids); | |||
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | 176 | ||
177 | static struct ad1848_mix_elem snd_cmi8330_controls[] __devinitdata = { | 177 | static struct snd_kcontrol_new snd_cmi8330_controls[] __devinitdata = { |
178 | AD1848_DOUBLE("Master Playback Volume", 0, CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0), | 178 | WSS_DOUBLE("Master Playback Volume", 0, |
179 | AD1848_SINGLE("Loud Playback Switch", 0, CMI8330_MUTEMUX, 6, 1, 1), | 179 | CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0), |
180 | AD1848_DOUBLE("PCM Playback Switch", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 7, 7, 1, 1), | 180 | WSS_SINGLE("Loud Playback Switch", 0, |
181 | AD1848_DOUBLE("PCM Playback Volume", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 0, 0, 63, 1), | 181 | CMI8330_MUTEMUX, 6, 1, 1), |
182 | AD1848_DOUBLE("Line Playback Switch", 0, CMI8330_MUTEMUX, CMI8330_MUTEMUX, 4, 3, 1, 0), | 182 | WSS_DOUBLE("PCM Playback Switch", 0, |
183 | AD1848_DOUBLE("Line Playback Volume", 0, CMI8330_LINVOL, CMI8330_LINVOL, 4, 0, 15, 0), | 183 | CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), |
184 | AD1848_DOUBLE("Line Capture Switch", 0, CMI8330_RMUX3D, CMI8330_RMUX3D, 2, 1, 1, 0), | 184 | WSS_DOUBLE("PCM Playback Volume", 0, |
185 | AD1848_DOUBLE("Line Capture Volume", 0, CMI8330_LINGAIN, CMI8330_LINGAIN, 4, 0, 15, 0), | 185 | CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1), |
186 | AD1848_DOUBLE("CD Playback Switch", 0, CMI8330_MUTEMUX, CMI8330_MUTEMUX, 2, 1, 1, 0), | 186 | WSS_DOUBLE("Line Playback Switch", 0, |
187 | AD1848_DOUBLE("CD Capture Switch", 0, CMI8330_RMUX3D, CMI8330_RMUX3D, 4, 3, 1, 0), | 187 | CMI8330_MUTEMUX, CMI8330_MUTEMUX, 4, 3, 1, 0), |
188 | AD1848_DOUBLE("CD Playback Volume", 0, CMI8330_CDINVOL, CMI8330_CDINVOL, 4, 0, 15, 0), | 188 | WSS_DOUBLE("Line Playback Volume", 0, |
189 | AD1848_DOUBLE("CD Capture Volume", 0, CMI8330_CDINGAIN, CMI8330_CDINGAIN, 4, 0, 15, 0), | 189 | CMI8330_LINVOL, CMI8330_LINVOL, 4, 0, 15, 0), |
190 | AD1848_SINGLE("Mic Playback Switch", 0, CMI8330_MUTEMUX, 0, 1, 0), | 190 | WSS_DOUBLE("Line Capture Switch", 0, |
191 | AD1848_SINGLE("Mic Playback Volume", 0, CMI8330_OUTPUTVOL, 0, 7, 0), | 191 | CMI8330_RMUX3D, CMI8330_RMUX3D, 2, 1, 1, 0), |
192 | AD1848_SINGLE("Mic Capture Switch", 0, CMI8330_RMUX3D, 0, 1, 0), | 192 | WSS_DOUBLE("Line Capture Volume", 0, |
193 | AD1848_SINGLE("Mic Capture Volume", 0, CMI8330_OUTPUTVOL, 5, 7, 0), | 193 | CMI8330_LINGAIN, CMI8330_LINGAIN, 4, 0, 15, 0), |
194 | AD1848_DOUBLE("Wavetable Playback Switch", 0, CMI8330_RECMUX, CMI8330_RECMUX, 1, 0, 1, 0), | 194 | WSS_DOUBLE("CD Playback Switch", 0, |
195 | AD1848_DOUBLE("Wavetable Playback Volume", 0, CMI8330_WAVVOL, CMI8330_WAVVOL, 4, 0, 15, 0), | 195 | CMI8330_MUTEMUX, CMI8330_MUTEMUX, 2, 1, 1, 0), |
196 | AD1848_DOUBLE("Wavetable Capture Switch", 0, CMI8330_RECMUX, CMI8330_RECMUX, 5, 4, 1, 0), | 196 | WSS_DOUBLE("CD Capture Switch", 0, |
197 | AD1848_DOUBLE("Wavetable Capture Volume", 0, CMI8330_WAVGAIN, CMI8330_WAVGAIN, 4, 0, 15, 0), | 197 | CMI8330_RMUX3D, CMI8330_RMUX3D, 4, 3, 1, 0), |
198 | AD1848_SINGLE("3D Control - Switch", 0, CMI8330_RMUX3D, 5, 1, 1), | 198 | WSS_DOUBLE("CD Playback Volume", 0, |
199 | AD1848_SINGLE("PC Speaker Playback Volume", 0, CMI8330_OUTPUTVOL, 3, 3, 0), | 199 | CMI8330_CDINVOL, CMI8330_CDINVOL, 4, 0, 15, 0), |
200 | AD1848_SINGLE("FM Playback Switch", 0, CMI8330_RECMUX, 3, 1, 1), | 200 | WSS_DOUBLE("CD Capture Volume", 0, |
201 | AD1848_SINGLE(SNDRV_CTL_NAME_IEC958("Input ",CAPTURE,SWITCH), 0, CMI8330_RMUX3D, 7, 1, 1), | 201 | CMI8330_CDINGAIN, CMI8330_CDINGAIN, 4, 0, 15, 0), |
202 | AD1848_SINGLE(SNDRV_CTL_NAME_IEC958("Input ",PLAYBACK,SWITCH), 0, CMI8330_MUTEMUX, 7, 1, 1), | 202 | WSS_SINGLE("Mic Playback Switch", 0, |
203 | CMI8330_MUTEMUX, 0, 1, 0), | ||
204 | WSS_SINGLE("Mic Playback Volume", 0, | ||
205 | CMI8330_OUTPUTVOL, 0, 7, 0), | ||
206 | WSS_SINGLE("Mic Capture Switch", 0, | ||
207 | CMI8330_RMUX3D, 0, 1, 0), | ||
208 | WSS_SINGLE("Mic Capture Volume", 0, | ||
209 | CMI8330_OUTPUTVOL, 5, 7, 0), | ||
210 | WSS_DOUBLE("Wavetable Playback Switch", 0, | ||
211 | CMI8330_RECMUX, CMI8330_RECMUX, 1, 0, 1, 0), | ||
212 | WSS_DOUBLE("Wavetable Playback Volume", 0, | ||
213 | CMI8330_WAVVOL, CMI8330_WAVVOL, 4, 0, 15, 0), | ||
214 | WSS_DOUBLE("Wavetable Capture Switch", 0, | ||
215 | CMI8330_RECMUX, CMI8330_RECMUX, 5, 4, 1, 0), | ||
216 | WSS_DOUBLE("Wavetable Capture Volume", 0, | ||
217 | CMI8330_WAVGAIN, CMI8330_WAVGAIN, 4, 0, 15, 0), | ||
218 | WSS_SINGLE("3D Control - Switch", 0, | ||
219 | CMI8330_RMUX3D, 5, 1, 1), | ||
220 | WSS_SINGLE("PC Speaker Playback Volume", 0, | ||
221 | CMI8330_OUTPUTVOL, 3, 3, 0), | ||
222 | WSS_SINGLE("FM Playback Switch", 0, | ||
223 | CMI8330_RECMUX, 3, 1, 1), | ||
224 | WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", CAPTURE, SWITCH), 0, | ||
225 | CMI8330_RMUX3D, 7, 1, 1), | ||
226 | WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", PLAYBACK, SWITCH), 0, | ||
227 | CMI8330_MUTEMUX, 7, 1, 1), | ||
203 | }; | 228 | }; |
204 | 229 | ||
205 | #ifdef ENABLE_SB_MIXER | 230 | #ifdef ENABLE_SB_MIXER |
@@ -268,7 +293,10 @@ static int __devinit snd_cmi8330_mixer(struct snd_card *card, struct snd_cmi8330 | |||
268 | strcpy(card->mixername, "CMI8330/C3D"); | 293 | strcpy(card->mixername, "CMI8330/C3D"); |
269 | 294 | ||
270 | for (idx = 0; idx < ARRAY_SIZE(snd_cmi8330_controls); idx++) { | 295 | for (idx = 0; idx < ARRAY_SIZE(snd_cmi8330_controls); idx++) { |
271 | if ((err = snd_ad1848_add_ctl_elem(acard->wss, &snd_cmi8330_controls[idx])) < 0) | 296 | err = snd_ctl_add(card, |
297 | snd_ctl_new1(&snd_cmi8330_controls[idx], | ||
298 | acard->wss)); | ||
299 | if (err < 0) | ||
272 | return err; | 300 | return err; |
273 | } | 301 | } |
274 | 302 | ||
@@ -385,7 +413,7 @@ static int __devinit snd_cmi8330_pcm(struct snd_card *card, struct snd_cmi8330 * | |||
385 | chip->streams[CMI_SB_STREAM].private_data = chip->sb; | 413 | chip->streams[CMI_SB_STREAM].private_data = chip->sb; |
386 | 414 | ||
387 | /* AD1848 */ | 415 | /* AD1848 */ |
388 | ops = snd_ad1848_get_pcm_ops(CMI_AD_STREAM); | 416 | ops = snd_wss_get_pcm_ops(CMI_AD_STREAM); |
389 | chip->streams[CMI_AD_STREAM].ops = *ops; | 417 | chip->streams[CMI_AD_STREAM].ops = *ops; |
390 | chip->streams[CMI_AD_STREAM].open = ops->open; | 418 | chip->streams[CMI_AD_STREAM].open = ops->open; |
391 | chip->streams[CMI_AD_STREAM].ops.open = cmi_open_callbacks[CMI_AD_STREAM]; | 419 | chip->streams[CMI_AD_STREAM].ops.open = cmi_open_callbacks[CMI_AD_STREAM]; |
@@ -461,16 +489,15 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) | |||
461 | int i, err; | 489 | int i, err; |
462 | 490 | ||
463 | acard = card->private_data; | 491 | acard = card->private_data; |
464 | if ((err = snd_ad1848_create(card, | 492 | err = snd_wss_create(card, wssport[dev] + 4, -1, |
465 | wssport[dev] + 4, | 493 | wssirq[dev], |
466 | wssirq[dev], | 494 | wssdma[dev], -1, |
467 | wssdma[dev], | 495 | WSS_HW_DETECT, 0, &acard->wss); |
468 | AD1848_HW_DETECT, | 496 | if (err < 0) { |
469 | &acard->wss)) < 0) { | ||
470 | snd_printk(KERN_ERR PFX "(AD1848) device busy??\n"); | 497 | snd_printk(KERN_ERR PFX "(AD1848) device busy??\n"); |
471 | return err; | 498 | return err; |
472 | } | 499 | } |
473 | if (acard->wss->hardware != AD1848_HW_CMI8330) { | 500 | if (acard->wss->hardware != WSS_HW_CMI8330) { |
474 | snd_printk(KERN_ERR PFX "(AD1848) not found during probe\n"); | 501 | snd_printk(KERN_ERR PFX "(AD1848) not found during probe\n"); |
475 | return -ENODEV; | 502 | return -ENODEV; |
476 | } | 503 | } |
@@ -489,9 +516,10 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) | |||
489 | return err; | 516 | return err; |
490 | } | 517 | } |
491 | 518 | ||
492 | snd_ad1848_out(acard->wss, AD1848_MISC_INFO, 0x40); /* switch on MODE2 */ | 519 | snd_wss_out(acard->wss, CS4231_MISC_INFO, 0x40); /* switch on MODE2 */ |
493 | for (i = CMI8330_RMUX3D; i <= CMI8330_CDINGAIN; i++) | 520 | for (i = CMI8330_RMUX3D; i <= CMI8330_CDINGAIN; i++) |
494 | snd_ad1848_out(acard->wss, i, snd_cmi8330_image[i - CMI8330_RMUX3D]); | 521 | snd_wss_out(acard->wss, i, |
522 | snd_cmi8330_image[i - CMI8330_RMUX3D]); | ||
495 | 523 | ||
496 | if ((err = snd_cmi8330_mixer(card, acard)) < 0) { | 524 | if ((err = snd_cmi8330_mixer(card, acard)) < 0) { |
497 | snd_printk(KERN_ERR PFX "failed to create mixers\n"); | 525 | snd_printk(KERN_ERR PFX "failed to create mixers\n"); |