50 #include <linux/module.h>
61 #define PLAYBACK_ON_SB
121 static int isa_registered;
122 static int pnp_registered;
125 #define CMI8330_RMUX3D 16
126 #define CMI8330_MUTEMUX 17
127 #define CMI8330_OUTPUTVOL 18
128 #define CMI8330_MASTVOL 19
129 #define CMI8330_LINVOL 20
130 #define CMI8330_CDINVOL 21
131 #define CMI8330_WAVVOL 22
132 #define CMI8330_RECMUX 23
133 #define CMI8330_WAVGAIN 24
134 #define CMI8330_LINGAIN 25
135 #define CMI8330_CDINGAIN 26
140 #ifdef ENABLE_SB_MIXER
186 { .
id =
"CMI0001", .devs = { {
"@X@0001" }, {
"@@@0001" }, {
"@H@0001" }, {
"A@@0001" } } },
187 { .id =
"CMI0001", .devs = { {
"@@@0001" }, {
"@X@0001" }, {
"@H@0001" } } },
251 #ifdef ENABLE_SB_MIXER
252 static struct sbmix_elem cmi8330_sb_mixers[] __devinitdata = {
270 static unsigned char cmi8330_sb_init_values[][2] __devinitdata = {
291 spin_unlock_irqrestore(&chip->
mixer_lock, flags);
294 for (idx = 0; idx <
ARRAY_SIZE(cmi8330_sb_init_values); idx++) {
297 cmi8330_sb_init_values[idx][1]);
298 spin_unlock_irqrestore(&chip->
mixer_lock, flags);
301 for (idx = 0; idx <
ARRAY_SIZE(cmi8330_sb_mixers); idx++) {
302 if ((err = snd_sbmixer_add_ctl_elem(chip, &cmi8330_sb_mixers[idx])) < 0)
316 for (idx = 0; idx <
ARRAY_SIZE(snd_cmi8330_controls); idx++) {
324 #ifdef ENABLE_SB_MIXER
325 if ((err = cmi8330_add_sb_mixers(acard->
sb)) < 0)
343 if (acard->cap ==
NULL)
347 if (acard->play ==
NULL)
351 if (acard->mpu ==
NULL)
361 wssport[
dev] = pnp_port_start(pdev, 0);
364 if (pnp_port_start(pdev, 1))
365 fmport[
dev] = pnp_port_start(pdev, 1);
375 sbport[
dev] = pnp_port_start(pdev, 0);
381 if (pnp_port_start(pdev, 1))
382 fmport[
dev] = pnp_port_start(pdev, 1);
394 mpuport[
dev] = pnp_port_start(pdev, 0);
414 #ifdef PLAYBACK_ON_SB
415 #define CMI_SB_STREAM SNDRV_PCM_STREAM_PLAYBACK
416 #define CMI_AD_STREAM SNDRV_PCM_STREAM_CAPTURE
418 #define CMI_SB_STREAM SNDRV_PCM_STREAM_CAPTURE
419 #define CMI_AD_STREAM SNDRV_PCM_STREAM_PLAYBACK
446 snd_cmi8330_playback_open,
447 snd_cmi8330_capture_open
482 static int snd_cmi8330_suspend(
struct snd_card *card)
487 snd_pcm_suspend_all(acard->
pcm);
488 acard->
wss->suspend(acard->
wss);
489 snd_sbmixer_suspend(acard->
sb);
493 static int snd_cmi8330_resume(
struct snd_card *card)
498 snd_sbmixer_suspend(acard->
sb);
499 acard->
wss->resume(acard->
wss);
510 #define is_isapnp_selected(dev) isapnp[dev]
512 #define is_isapnp_selected(dev) 0
515 #define PFX "cmi8330: "
517 static int snd_cmi8330_card_new(
int dev,
struct snd_card **cardp)
574 if ((err = snd_cmi8330_mixer(card, acard)) < 0) {
579 if ((err = snd_cmi8330_pcm(card, acard)) < 0) {
585 fmport[dev], fmport[dev] + 2,
588 "no OPL device at 0x%lx-0x%lx ?\n",
589 fmport[dev], fmport[dev] + 2);
599 mpuport[dev], 0, mpuirq[dev],
638 err = snd_cmi8330_card_new(dev, &card);
642 if ((err = snd_cmi8330_probe(card, dev)) < 0) {
659 static int snd_cmi8330_isa_suspend(
struct device *dev,
unsigned int n,
665 static int snd_cmi8330_isa_resume(
struct device *dev,
unsigned int n)
671 #define DEV_NAME "cmi8330"
673 static struct isa_driver snd_cmi8330_driver = {
674 .match = snd_cmi8330_isa_match,
675 .probe = snd_cmi8330_isa_probe,
678 .suspend = snd_cmi8330_isa_suspend,
679 .resume = snd_cmi8330_isa_resume,
696 if (
enable[dev] && isapnp[dev])
699 if (dev >= SNDRV_CARDS)
702 res = snd_cmi8330_card_new(dev, &card);
705 if ((res = snd_cmi8330_pnp(dev, card->
private_data, pcard, pid)) < 0) {
711 if ((res = snd_cmi8330_probe(card, dev)) < 0) {
715 pnp_set_card_drvdata(pcard, card);
723 pnp_set_card_drvdata(pcard,
NULL);
729 return snd_cmi8330_suspend(pnp_get_card_drvdata(pcard));
732 static int snd_cmi8330_pnp_resume(
struct pnp_card_link *pcard)
734 return snd_cmi8330_resume(pnp_get_card_drvdata(pcard));
741 .id_table = snd_cmi8330_pnpids,
742 .probe = snd_cmi8330_pnp_detect,
745 .suspend = snd_cmi8330_pnp_suspend,
746 .resume = snd_cmi8330_pnp_resume,
751 static int __init alsa_card_cmi8330_init(
void)
770 static void __exit alsa_card_cmi8330_exit(
void)