/[openvortex]/alsa/alsa-kernel/pci/ali5451/ali5451.c
ViewVC logotype

Diff of /alsa/alsa-kernel/pci/ali5451/ali5451.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by vizard, Sat May 31 02:35:11 2003 UTC revision 1.3 by vizard, Mon Aug 11 00:06:39 2003 UTC
# Line 1891  static int __devinit snd_ali_mixer(ali_t Line 1891  static int __devinit snd_ali_mixer(ali_t
1891  }  }
1892    
1893  #ifdef CONFIG_PM  #ifdef CONFIG_PM
1894  #ifndef PCI_OLD_SUSPEND  static void ali_suspend(ali_t *chip)
 static int snd_ali_suspend(struct pci_dev *dev, u32 state)  
 #else  
 static void snd_ali_suspend(struct pci_dev *dev)  
 #endif  
1895  {  {
 #ifndef PCI_OLD_SUSPEND  
         ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return -ENXIO);  
 #else  
         ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return);  
 #endif  
1896          ali_image_t *im;          ali_image_t *im;
1897          int i, j;          int i, j;
1898    
1899          im = chip->image;          im = chip->image;
1900          if (! im)          if (! im)
 #ifndef PCI_OLD_SUSPEND  
                 return -ENXIO;  
 #else  
1901                  return;                  return;
 #endif  
1902    
1903          spin_lock_irq(&chip->reg_lock);          spin_lock_irq(&chip->reg_lock);
1904                    
# Line 1938  static void snd_ali_suspend(struct pci_d Line 1925  static void snd_ali_suspend(struct pci_d
1925          outl(0xffffffff, ALI_REG(chip, ALI_STOP));          outl(0xffffffff, ALI_REG(chip, ALI_STOP));
1926    
1927          spin_unlock_irq(&chip->reg_lock);          spin_unlock_irq(&chip->reg_lock);
 #ifndef PCI_OLD_SUSPEND  
         return 0;  
 #endif  
1928  }  }
1929    
1930  #ifndef PCI_OLD_SUSPEND  static void ali_resume(ali_t *chip)
 static int snd_ali_resume(struct pci_dev *dev)  
 #else  
 static void snd_ali_resume(struct pci_dev *dev)  
 #endif  
1931  {  {
 #ifndef PCI_OLD_SUSPEND  
         ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return -ENXIO);  
 #else  
         ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return);  
 #endif  
1932          ali_image_t *im;          ali_image_t *im;
1933          int i, j;          int i, j;
1934    
1935          im = chip->image;          im = chip->image;
1936          if (! im)          if (! im)
 #ifndef PCI_OLD_SUSPEND  
                 return -ENXIO;  
 #else  
1937                  return;                  return;
 #endif  
1938    
1939          pci_enable_device(chip->pci);          pci_enable_device(chip->pci);
1940    
# Line 1989  static void snd_ali_resume(struct pci_de Line 1960  static void snd_ali_resume(struct pci_de
1960          outl(im->regs[ALI_MISCINT >> 2], ALI_REG(chip, ALI_MISCINT));          outl(im->regs[ALI_MISCINT >> 2], ALI_REG(chip, ALI_MISCINT));
1961                    
1962          spin_unlock_irq(&chip->reg_lock);          spin_unlock_irq(&chip->reg_lock);
1963  #ifndef PCI_OLD_SUSPEND          return;
1964    }
1965    
1966    static int snd_ali_suspend(struct pci_dev *dev, u32 state)
1967    {
1968            ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return -ENXIO);
1969            ali_suspend(chip);
1970          return 0;          return 0;
 #endif  
1971  }  }
1972  #endif  static int snd_ali_resume(struct pci_dev *dev)
1973    {
1974            ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return -ENXIO);
1975            ali_resume(chip);
1976            return 0;
1977    }
1978    #endif /* CONFIG_PM */
1979    
1980  static int snd_ali_free(ali_t * codec)  static int snd_ali_free(ali_t * codec)
1981  {  {
# Line 2181  static int __devinit snd_ali_create(snd_ Line 2163  static int __devinit snd_ali_create(snd_
2163          /* M7101: power management */          /* M7101: power management */
2164          pci_dev = pci_find_device(0x10b9, 0x7101, NULL);          pci_dev = pci_find_device(0x10b9, 0x7101, NULL);
2165          codec->pci_m7101 = pci_dev;          codec->pci_m7101 = pci_dev;
2166          if (! codec->pci_m7101) {          if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) {
2167                  snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");                  snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");
2168                  snd_ali_free(codec);                  snd_ali_free(codec);
2169                  return -ENODEV;                  return -ENODEV;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26