aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opl3sa2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r--sound/isa/opl3sa2.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 645491a53023..ef95279da7a3 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) {
@@ -550,21 +554,27 @@ static int __devinit snd_opl3sa2_mixer(struct snd_card *card)
550#ifdef CONFIG_PM 554#ifdef CONFIG_PM
551static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) 555static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
552{ 556{
553 struct snd_opl3sa2 *chip = card->private_data; 557 if (card) {
558 struct snd_opl3sa2 *chip = card->private_data;
554 559
555 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 560 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
556 chip->wss->suspend(chip->wss); 561 chip->wss->suspend(chip->wss);
557 /* power down */ 562 /* power down */
558 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); 563 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
564 }
559 565
560 return 0; 566 return 0;
561} 567}
562 568
563static int snd_opl3sa2_resume(struct snd_card *card) 569static int snd_opl3sa2_resume(struct snd_card *card)
564{ 570{
565 struct snd_opl3sa2 *chip = card->private_data; 571 struct snd_opl3sa2 *chip;
566 int i; 572 int i;
567 573
574 if (!card)
575 return 0;
576
577 chip = card->private_data;
568 /* power up */ 578 /* power up */
569 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); 579 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
570 580
@@ -613,7 +623,7 @@ static void snd_opl3sa2_free(struct snd_card *card)
613{ 623{
614 struct snd_opl3sa2 *chip = card->private_data; 624 struct snd_opl3sa2 *chip = card->private_data;
615 if (chip->irq >= 0) 625 if (chip->irq >= 0)
616 free_irq(chip->irq, (void *)chip); 626 free_irq(chip->irq, card);
617 release_and_free_resource(chip->res_port); 627 release_and_free_resource(chip->res_port);
618} 628}
619 629
@@ -628,7 +638,7 @@ static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp)
628 if (err < 0) 638 if (err < 0)
629 return err; 639 return err;
630 strcpy(card->driver, "OPL3SA2"); 640 strcpy(card->driver, "OPL3SA2");
631 strcpy(card->shortname, "Yamaha OPL3-SA2"); 641 strcpy(card->shortname, "Yamaha OPL3-SA");
632 chip = card->private_data; 642 chip = card->private_data;
633 spin_lock_init(&chip->reg_lock); 643 spin_lock_init(&chip->reg_lock);
634 chip->irq = -1; 644 chip->irq = -1;