X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=sound%2Fpci%2Fintel8x0.c;h=9c1bce7afa867b169a33271b0b053bbce7ebf830;hb=bdbf77d6707a52bdeff223d0a60df12d086d21d7;hp=6874263f1681f0dd01475ee8871b363e9a0713e4;hpb=20f99dcf417a28089ef6c877ae97f5dec2eab435;p=linux-2.6-omap-h63xx.git diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 6874263f168..9c1bce7afa8 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -801,7 +801,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich status & (ICH_FIFOE | ICH_BCIS | ICH_LVBCI)); } -static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id) { struct intel8x0 *chip = dev_id; struct ichdev *ichdev; @@ -1961,6 +1961,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "Tyan Thunder K8WE", .type = AC97_TUNE_HP_ONLY }, + { + .subvendor = 0x10f7, + .subdevice = 0x834c, + .name = "Panasonic CF-R4", + .type = AC97_TUNE_HP_ONLY, + }, { .subvendor = 0x110a, .subdevice = 0x0056, @@ -2251,6 +2257,16 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing) /* ACLink on, 2 channels */ cnt = igetdword(chip, ICHREG(GLOB_CNT)); cnt &= ~(ICH_ACLINK | ICH_PCM_246_MASK); +#ifdef CONFIG_SND_AC97_POWER_SAVE + /* do cold reset - the full ac97 powerdown may leave the controller + * in a warm state but actually it cannot communicate with the codec. + */ + iputdword(chip, ICHREG(GLOB_CNT), cnt & ~ICH_AC97COLD); + cnt = igetdword(chip, ICHREG(GLOB_CNT)); + udelay(10); + iputdword(chip, ICHREG(GLOB_CNT), cnt | ICH_AC97COLD); + msleep(1); +#else /* finish cold or do warm reset */ cnt |= (cnt & ICH_AC97COLD) == 0 ? ICH_AC97COLD : ICH_AC97WARM; iputdword(chip, ICHREG(GLOB_CNT), cnt); @@ -2265,6 +2281,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing) return -EIO; __ok: +#endif if (probing) { /* wait for any codec ready status. * Once it becomes ready it should remain ready @@ -2465,10 +2482,14 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) if (chip->device_type == DEVICE_INTEL_ICH4) chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); - if (chip->irq >= 0) + if (chip->irq >= 0) { + synchronize_irq(chip->irq); free_irq(chip->irq, chip); + chip->irq = -1; + } pci_disable_device(pci); pci_save_state(pci); + pci_set_power_state(pci, pci_choose_state(pci, state)); return 0; } @@ -2478,14 +2499,25 @@ static int intel8x0_resume(struct pci_dev *pci) struct intel8x0 *chip = card->private_data; int i; + pci_set_power_state(pci, PCI_D0); pci_restore_state(pci); - pci_enable_device(pci); + if (pci_enable_device(pci) < 0) { + printk(KERN_ERR "intel8x0: pci_enable_device failed, " + "disabling device\n"); + snd_card_disconnect(card); + return -EIO; + } pci_set_master(pci); - request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED, - card->shortname, chip); + if (request_irq(pci->irq, snd_intel8x0_interrupt, + IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) { + printk(KERN_ERR "intel8x0: unable to grab IRQ %d, " + "disabling device\n", pci->irq); + snd_card_disconnect(card); + return -EIO; + } chip->irq = pci->irq; synchronize_irq(chip->irq); - snd_intel8x0_chip_init(chip, 1); + snd_intel8x0_chip_init(chip, 0); /* re-initialize mixer stuff */ if (chip->device_type == DEVICE_INTEL_ICH4) { @@ -2615,6 +2647,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip) /* not 48000Hz, tuning the clock.. */ chip->ac97_bus->clock = (chip->ac97_bus->clock * 48000) / pos; printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock); + snd_ac97_update_power(chip->ac97[0], AC97_PCM_FRONT_DAC_RATE, 0); } #ifdef CONFIG_PROC_FS