]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'fix/opl3sa2-suspend' into topic/isa-misc
authorTakashi Iwai <tiwai@suse.de>
Tue, 17 Mar 2009 08:28:13 +0000 (09:28 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 17 Mar 2009 08:28:13 +0000 (09:28 +0100)
1  2 
sound/isa/opl3sa2.c

diff --combined sound/isa/opl3sa2.c
index 19b2d0420a26ddd1a3e17b957ff8870b87b60db5,b848d10018641c3e280d024da3ed8521fde90be8..3f0b877bc8b585abe170303922a792481184c13f
@@@ -179,13 -179,12 +179,13 @@@ static unsigned char __snd_opl3sa2_read
        unsigned char result;
  #if 0
        outb(0x1d, port);       /* password */
 -      printk("read [0x%lx] = 0x%x\n", port, inb(port));
 +      printk(KERN_DEBUG "read [0x%lx] = 0x%x\n", port, inb(port));
  #endif
        outb(reg, chip->port);  /* register */
        result = inb(chip->port + 1);
  #if 0
 -      printk("read [0x%lx] = 0x%x [0x%x]\n", port, result, inb(port));
 +      printk(KERN_DEBUG "read [0x%lx] = 0x%x [0x%x]\n",
 +             port, result, inb(port));
  #endif
        return result;
  }
@@@ -234,10 -233,7 +234,10 @@@ static int __devinit snd_opl3sa2_detect
                snd_printk(KERN_ERR PFX "can't grab port 0x%lx\n", port);
                return -EBUSY;
        }
 -      // snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a));
 +      /*
 +      snd_printk(KERN_DEBUG "REG 0A = 0x%x\n",
 +                 snd_opl3sa2_read(chip, 0x0a));
 +      */
        chip->version = 0;
        tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC);
        if (tmp == 0xff) {
@@@ -554,21 -550,27 +554,27 @@@ static int __devinit snd_opl3sa2_mixer(
  #ifdef CONFIG_PM
  static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
  {
-       struct snd_opl3sa2 *chip = card->private_data;
+       if (card) {
+               struct snd_opl3sa2 *chip = card->private_data;
  
-       snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
-       chip->wss->suspend(chip->wss);
-       /* power down */
-       snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
+               snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+               chip->wss->suspend(chip->wss);
+               /* power down */
+               snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
+       }
  
        return 0;
  }
  
  static int snd_opl3sa2_resume(struct snd_card *card)
  {
-       struct snd_opl3sa2 *chip = card->private_data;
+       struct snd_opl3sa2 *chip;
        int i;
  
+       if (!card)
+               return 0;
+       chip = card->private_data;
        /* power up */
        snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
  
@@@ -617,7 -619,7 +623,7 @@@ static void snd_opl3sa2_free(struct snd
  {
        struct snd_opl3sa2 *chip = card->private_data;
        if (chip->irq >= 0)
 -              free_irq(chip->irq, (void *)chip);
 +              free_irq(chip->irq, card);
        release_and_free_resource(chip->res_port);
  }
  
@@@ -630,7 -632,7 +636,7 @@@ static struct snd_card *snd_opl3sa2_car
        if (card == NULL)
                return NULL;
        strcpy(card->driver, "OPL3SA2");
 -      strcpy(card->shortname, "Yamaha OPL3-SA2");
 +      strcpy(card->shortname, "Yamaha OPL3-SA");
        chip = card->private_data;
        spin_lock_init(&chip->reg_lock);
        chip->irq = -1;