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 |
|
|
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 |
|
|
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 |
{ |
{ |
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; |