int snd_cs5535audio_resume(struct pci_dev *pci) { struct snd_card *card = pci_get_drvdata(pci); struct cs5535audio *cs5535au = card->private_data; u32 tmp; int timeout; int i; pci_set_power_state(pci, PCI_D0); if (pci_restore_state(pci) < 0) { printk(KERN_ERR "cs5535audio: pci_restore_state failed, " "disabling device\n"); snd_card_disconnect(card); return -EIO; } if (pci_enable_device(pci) < 0) { printk(KERN_ERR "cs5535audio: pci_enable_device failed, " "disabling device\n"); snd_card_disconnect(card); return -EIO; } pci_set_master(pci); /* set LNK_WRM_RST to reset AC link */ cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_WRM_RST); timeout = 50; do { tmp = cs_readl(cs5535au, ACC_CODEC_STATUS); if (tmp & PRM_RDY_STS) break; udelay(1); } while (--timeout); if (!timeout) snd_printk(KERN_ERR "Failure getting AC Link ready\n"); /* set up rate regs, dma. actual initiation is done in trig */ for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) { struct cs5535audio_dma *dma = &cs5535au->dmas[i]; if (dma && dma->substream) { dma->substream->ops->prepare(dma->substream); dma->ops->setup_prd(cs5535au, dma->saved_prd); } } /* we depend on ac97 to perform the codec power up */ snd_ac97_resume(cs5535au->ac97); snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; }
static u32 cs5535audio_capture_read_dma_pntr(struct cs5535audio *cs5535au) { return cs_readl(cs5535au, ACC_BM1_PNTR); }
static u32 cs5535audio_capture_read_prd(struct cs5535audio *cs5535au) { return cs_readl(cs5535au, ACC_BM1_PRD); }
static u32 cs5535audio_playback_read_dma_pntr(struct cs5535audio *cs5535au) { return cs_readl(cs5535au, ACC_BM0_PNTR); }
static u32 cs5535audio_playback_read_prd(struct cs5535audio *cs5535au) { return cs_readl(cs5535au, ACC_BM0_PRD); }