diff options
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r-- | sound/isa/opl3sa2.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 645491a53023..0481a55334b9 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -179,12 +179,13 @@ static unsigned char __snd_opl3sa2_read(struct snd_opl3sa2 *chip, unsigned char | |||
179 | unsigned char result; | 179 | unsigned char result; |
180 | #if 0 | 180 | #if 0 |
181 | outb(0x1d, port); /* password */ | 181 | outb(0x1d, port); /* password */ |
182 | printk("read [0x%lx] = 0x%x\n", port, inb(port)); | 182 | printk(KERN_DEBUG "read [0x%lx] = 0x%x\n", port, inb(port)); |
183 | #endif | 183 | #endif |
184 | outb(reg, chip->port); /* register */ | 184 | outb(reg, chip->port); /* register */ |
185 | result = inb(chip->port + 1); | 185 | result = inb(chip->port + 1); |
186 | #if 0 | 186 | #if 0 |
187 | printk("read [0x%lx] = 0x%x [0x%x]\n", port, result, inb(port)); | 187 | printk(KERN_DEBUG "read [0x%lx] = 0x%x [0x%x]\n", |
188 | port, result, inb(port)); | ||
188 | #endif | 189 | #endif |
189 | return result; | 190 | return result; |
190 | } | 191 | } |
@@ -233,7 +234,10 @@ static int __devinit snd_opl3sa2_detect(struct snd_card *card) | |||
233 | snd_printk(KERN_ERR PFX "can't grab port 0x%lx\n", port); | 234 | snd_printk(KERN_ERR PFX "can't grab port 0x%lx\n", port); |
234 | return -EBUSY; | 235 | return -EBUSY; |
235 | } | 236 | } |
236 | // snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a)); | 237 | /* |
238 | snd_printk(KERN_DEBUG "REG 0A = 0x%x\n", | ||
239 | snd_opl3sa2_read(chip, 0x0a)); | ||
240 | */ | ||
237 | chip->version = 0; | 241 | chip->version = 0; |
238 | tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC); | 242 | tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC); |
239 | if (tmp == 0xff) { | 243 | if (tmp == 0xff) { |
@@ -477,6 +481,7 @@ OPL3SA2_DOUBLE_TLV("Master Playback Volume", 0, 0x07, 0x08, 0, 0, 15, 1, | |||
477 | OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1), | 481 | OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1), |
478 | OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, | 482 | OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, |
479 | db_scale_5bit_12db_max), | 483 | db_scale_5bit_12db_max), |
484 | OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0), | ||
480 | }; | 485 | }; |
481 | 486 | ||
482 | static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { | 487 | static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { |
@@ -550,21 +555,27 @@ static int __devinit snd_opl3sa2_mixer(struct snd_card *card) | |||
550 | #ifdef CONFIG_PM | 555 | #ifdef CONFIG_PM |
551 | static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) | 556 | static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) |
552 | { | 557 | { |
553 | struct snd_opl3sa2 *chip = card->private_data; | 558 | if (card) { |
559 | struct snd_opl3sa2 *chip = card->private_data; | ||
554 | 560 | ||
555 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 561 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
556 | chip->wss->suspend(chip->wss); | 562 | chip->wss->suspend(chip->wss); |
557 | /* power down */ | 563 | /* power down */ |
558 | snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); | 564 | snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); |
565 | } | ||
559 | 566 | ||
560 | return 0; | 567 | return 0; |
561 | } | 568 | } |
562 | 569 | ||
563 | static int snd_opl3sa2_resume(struct snd_card *card) | 570 | static int snd_opl3sa2_resume(struct snd_card *card) |
564 | { | 571 | { |
565 | struct snd_opl3sa2 *chip = card->private_data; | 572 | struct snd_opl3sa2 *chip; |
566 | int i; | 573 | int i; |
567 | 574 | ||
575 | if (!card) | ||
576 | return 0; | ||
577 | |||
578 | chip = card->private_data; | ||
568 | /* power up */ | 579 | /* power up */ |
569 | snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); | 580 | snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); |
570 | 581 | ||
@@ -613,7 +624,7 @@ static void snd_opl3sa2_free(struct snd_card *card) | |||
613 | { | 624 | { |
614 | struct snd_opl3sa2 *chip = card->private_data; | 625 | struct snd_opl3sa2 *chip = card->private_data; |
615 | if (chip->irq >= 0) | 626 | if (chip->irq >= 0) |
616 | free_irq(chip->irq, (void *)chip); | 627 | free_irq(chip->irq, card); |
617 | release_and_free_resource(chip->res_port); | 628 | release_and_free_resource(chip->res_port); |
618 | } | 629 | } |
619 | 630 | ||
@@ -628,7 +639,7 @@ static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp) | |||
628 | if (err < 0) | 639 | if (err < 0) |
629 | return err; | 640 | return err; |
630 | strcpy(card->driver, "OPL3SA2"); | 641 | strcpy(card->driver, "OPL3SA2"); |
631 | strcpy(card->shortname, "Yamaha OPL3-SA2"); | 642 | strcpy(card->shortname, "Yamaha OPL3-SA"); |
632 | chip = card->private_data; | 643 | chip = card->private_data; |
633 | spin_lock_init(&chip->reg_lock); | 644 | spin_lock_init(&chip->reg_lock); |
634 | chip->irq = -1; | 645 | chip->irq = -1; |