Ignore:
Timestamp:
Dec 13, 2005, 9:08:20 PM (20 years ago)
Author:
vladest
Message:

Fixed UNIAUD API
Added PM support for Yamaha chipsets
Added PM support for Intel chipsets

Location:
GPL/trunk/alsa-kernel/pci/ymfpci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/pci/ymfpci/ymfpci.c

    r34 r35  
    191191        }
    192192        chip->fm_res = fm_res;
    193         chip->mpu_res = mpu_res;
     193        chip->mpu_res = mpu_res;
     194        card->private_data = chip;
     195
    194196        strcpy(card->driver, str);
    195197        sprintf(card->shortname, "Yamaha DS-XG (%s)", str);
     
    270272
    271273static struct pci_driver driver = {
    272         0,0,0,"Yamaha DS-XG PCI",
    273         snd_ymfpci_ids,
    274         snd_card_ymfpci_probe,
    275         snd_card_ymfpci_remove,
    276         SND_PCI_PM_CALLBACKS
     274    .name = "Yamaha DS-1 PCI",
     275    .id_table = snd_ymfpci_ids,
     276    .probe = snd_card_ymfpci_probe,
     277    .remove = snd_card_ymfpci_remove,
     278#ifdef CONFIG_PM
     279    .suspend = snd_ymfpci_suspend,
     280    .resume = snd_ymfpci_resume,
     281#endif
    277282};
     283
    278284
    279285static int __init alsa_card_ymfpci_init(void)
  • GPL/trunk/alsa-kernel/pci/ymfpci/ymfpci_main.c

    r34 r35  
    728728    u32 status, nvoice, mode;
    729729    ymfpci_voice_t *voice;
    730 #ifdef TARGET_OS2
    731     int fOurIrq = FALSE;
    732 #endif
    733730
    734731    status = snd_ymfpci_readl(chip, YDSXGR_STATUS);
    735732    if (status & 0x80000000) {
    736 #ifdef TARGET_OS2
    737         fOurIrq = TRUE;
    738 #endif
    739733        chip->active_bank = snd_ymfpci_readl(chip, YDSXGR_CTRLSELECT) & 1;
    740734        spin_lock(&chip->voice_lock);
     
    775769    if (chip->rawmidi)
    776770        snd_mpu401_uart_interrupt(irq, chip->rawmidi->private_data, regs);
    777 #ifdef TARGET_OS2
    778     if (fOurIrq) {
    779         eoi_irq(irq);
    780     }
    781 #endif //TARGET_OS2
    782771    return IRQ_HANDLED;
    783772}
     
    22262215#define YDSXGR_NUM_SAVED_REGS   ARRAY_SIZE(saved_regs_index)
    22272216
    2228 static int snd_ymfpci_suspend(snd_card_t *card, unsigned int state)
    2229 {
    2230     ymfpci_t *chip = card->pm_private_data;
     2217int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
     2218{
     2219    struct snd_card *card = pci_get_drvdata(pci);
     2220    struct snd_ymfpci *chip = card->private_data;
    22312221    unsigned int i;
    22322222
     2223    snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
    22332224    snd_pcm_suspend_all(chip->pcm);
    22342225    snd_pcm_suspend_all(chip->pcm2);
     
    22412232    snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0);
    22422233    snd_ymfpci_disable_dsp(chip);
    2243     return 0;
    2244 }
    2245 
    2246 static int snd_ymfpci_resume(snd_card_t *card, unsigned int state)
    2247 {
    2248     ymfpci_t *chip = card->pm_private_data;
     2234    pci_disable_device(pci);
     2235    pci_save_state(pci);
     2236    return 0;
     2237}
     2238
     2239int snd_ymfpci_resume(struct pci_dev *pci)
     2240{
     2241    struct snd_card *card = pci_get_drvdata(pci);
     2242    struct snd_ymfpci *chip = card->private_data;
    22492243    unsigned int i;
    22502244
    2251     pci_enable_device(chip->pci);
    2252     pci_set_master(chip->pci);
    2253     snd_ymfpci_aclink_reset(chip->pci);
     2245    pci_restore_state(pci);
     2246    pci_enable_device(pci);
     2247    pci_set_master(pci);
     2248    snd_ymfpci_aclink_reset(pci);
    22542249    snd_ymfpci_codec_ready(chip, 0);
    22552250    snd_ymfpci_download_image(chip);
     
    22682263        spin_unlock_irq(&chip->reg_lock);
    22692264    }
    2270     return 0;
    2271 }
     2265    snd_power_change_state(card, SNDRV_CTL_POWER_D0);
     2266    return 0;
     2267}
     2268
    22722269#endif /* CONFIG_PM */
    22732270
     
    23542351        return -ENOMEM;
    23552352    }
    2356     snd_card_set_pm_callback(card, snd_ymfpci_suspend, snd_ymfpci_resume, chip);
    23572353#endif
    2358 
    2359     snd_ymfpci_proc_init(card, chip);
    23602354
    23612355    if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
     
    23642358    }
    23652359
     2360    snd_ymfpci_proc_init(card, chip);
     2361
    23662362    snd_card_set_dev(card, &pci->dev);
    23672363
Note: See TracChangeset for help on using the changeset viewer.