Changeset 305 for GPL/branches/uniaud-2.0/alsa-kernel/pci/ens1370.c
- Timestamp:
- Mar 24, 2008, 2:43:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud-2.0/alsa-kernel/pci/ens1370.c
r73 r305 1 1 /* 2 2 * Driver for Ensoniq ES1370/ES1371 AudioPCI soundcard 3 * Copyright (c) by Jaroslav Kysela <perex@ suse.cz>,3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 4 4 * Thomas Sailer <sailer@ife.ee.ethz.ch> 5 5 * … … 27 27 */ 28 28 29 #include <sound/driver.h>30 29 #include <asm/io.h> 31 30 #include <linux/delay.h> … … 34 33 #include <linux/pci.h> 35 34 #include <linux/slab.h> 36 //#include <linux/gameport.h>35 #include <linux/gameport.h> 37 36 #include <linux/moduleparam.h> 37 #include <linux/mutex.h> 38 38 39 #include <sound/core.h> 39 40 #include <sound/control.h> … … 48 49 #include <sound/asoundef.h> 49 50 50 #ifndef PCI_DEVICE_ID_ENSONIQ_CT588051 #define PCI_DEVICE_ID_ENSONIQ_CT5880 0x588052 #endif53 54 51 #ifndef CHIP1371 55 52 #undef CHIP1370 … … 64 61 65 62 66 MODULE_AUTHOR("Jaroslav Kysela <perex@ suse.cz>, Thomas Sailer <sailer@ife.ee.ethz.ch>");63 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Thomas Sailer <sailer@ife.ee.ethz.ch>"); 67 64 MODULE_LICENSE("GPL"); 68 65 #ifdef CHIP1370 … … 100 97 #endif 101 98 102 //module_param_array(index, int, NULL, 0444);99 module_param_array(index, int, NULL, 0444); 103 100 MODULE_PARM_DESC(index, "Index value for Ensoniq AudioPCI soundcard."); 104 //module_param_array(id, charp, NULL, 0444);101 module_param_array(id, charp, NULL, 0444); 105 102 MODULE_PARM_DESC(id, "ID string for Ensoniq AudioPCI soundcard."); 106 //module_param_array(enable, bool, NULL, 0444);103 module_param_array(enable, bool, NULL, 0444); 107 104 MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard."); 108 105 #ifdef SUPPORT_JOYSTICK 109 106 #ifdef CHIP1371 110 //module_param_array(joystick_port, int, NULL, 0444);107 module_param_array(joystick_port, int, NULL, 0444); 111 108 MODULE_PARM_DESC(joystick_port, "Joystick port address."); 112 109 #else 113 //module_param_array(joystick, bool, NULL, 0444);110 module_param_array(joystick, bool, NULL, 0444); 114 111 MODULE_PARM_DESC(joystick, "Enable joystick."); 115 112 #endif 116 113 #endif /* SUPPORT_JOYSTICK */ 117 114 #ifdef CHIP1371 118 //module_param_array(spdif, int, NULL, 0444);115 module_param_array(spdif, int, NULL, 0444); 119 116 MODULE_PARM_DESC(spdif, "S/PDIF output (-1 = none, 0 = auto, 1 = force)."); 120 //module_param_array(lineio, int, NULL, 0444);117 module_param_array(lineio, int, NULL, 0444); 121 118 MODULE_PARM_DESC(lineio, "Line In to Rear Out (0 = auto, 1 = force)."); 122 119 #endif … … 384 381 struct ensoniq { 385 382 spinlock_t reg_lock; 386 struct semaphoresrc_mutex;383 struct mutex src_mutex; 387 384 388 385 int irq; … … 416 413 417 414 struct pci_dev *pci; 418 unsigned short subsystem_vendor_id;419 unsigned short subsystem_device_id;420 415 struct snd_card *card; 421 416 struct snd_pcm *pcm1; /* DAC1/ADC PCM */ … … 447 442 }; 448 443 449 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id , struct pt_regs *regs);444 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id); 450 445 451 446 static struct pci_device_id snd_audiopci_ids[] = { … … 614 609 unsigned int t, x; 615 610 616 down(&ensoniq->src_mutex);611 mutex_lock(&ensoniq->src_mutex); 617 612 for (t = 0; t < POLL_COUNT; t++) { 618 613 if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) { … … 639 634 snd_es1371_wait_src_ready(ensoniq); 640 635 outl(x, ES_REG(ensoniq, 1371_SMPRATE)); 641 up(&ensoniq->src_mutex);636 mutex_unlock(&ensoniq->src_mutex); 642 637 return; 643 638 } 644 639 } 645 up(&ensoniq->src_mutex);640 mutex_unlock(&ensoniq->src_mutex); 646 641 snd_printk(KERN_ERR "codec write timeout at 0x%lx [0x%x]\n", 647 642 ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC))); … … 655 650 656 651 __again: 657 down(&ensoniq->src_mutex);652 mutex_lock(&ensoniq->src_mutex); 658 653 for (t = 0; t < POLL_COUNT; t++) { 659 654 if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) { … … 688 683 for (t = 0; t < POLL_COUNT; t++) { 689 684 if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) { 690 up(&ensoniq->src_mutex);685 mutex_unlock(&ensoniq->src_mutex); 691 686 return ES_1371_CODEC_READ(x); 692 687 } 693 688 } 694 up(&ensoniq->src_mutex);689 mutex_unlock(&ensoniq->src_mutex); 695 690 if (++fail > 10) { 696 691 snd_printk(KERN_ERR "codec read timeout (final) " … … 703 698 } 704 699 } 705 up(&ensoniq->src_mutex);700 mutex_unlock(&ensoniq->src_mutex); 706 701 snd_printk(KERN_ERR "es1371: codec read timeout at 0x%lx [0x%x]\n", 707 702 ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC))); … … 722 717 unsigned int n, truncm, freq, result; 723 718 724 down(&ensoniq->src_mutex);719 mutex_lock(&ensoniq->src_mutex); 725 720 n = rate / 3000; 726 721 if ((1 << n) & ((1 << 15) | (1 << 13) | (1 << 11) | (1 << 9))) … … 747 742 snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC, n << 8); 748 743 snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC + 1, n << 8); 749 up(&ensoniq->src_mutex);744 mutex_unlock(&ensoniq->src_mutex); 750 745 } 751 746 … … 754 749 unsigned int freq, r; 755 750 756 down(&ensoniq->src_mutex);751 mutex_lock(&ensoniq->src_mutex); 757 752 freq = ((rate << 15) + 1500) / 3000; 758 753 r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE | … … 768 763 ES_1371_DIS_P2 | ES_1371_DIS_R1)); 769 764 outl(r, ES_REG(ensoniq, 1371_SMPRATE)); 770 up(&ensoniq->src_mutex);765 mutex_unlock(&ensoniq->src_mutex); 771 766 } 772 767 … … 775 770 unsigned int freq, r; 776 771 777 down(&ensoniq->src_mutex);772 mutex_lock(&ensoniq->src_mutex); 778 773 freq = ((rate << 15) + 1500) / 3000; 779 774 r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE | … … 790 785 ES_1371_DIS_P1 | ES_1371_DIS_R1)); 791 786 outl(r, ES_REG(ensoniq, 1371_SMPRATE)); 792 up(&ensoniq->src_mutex);787 mutex_unlock(&ensoniq->src_mutex); 793 788 } 794 789 … … 803 798 { 804 799 unsigned int what = 0; 805 struct list_head *pos;806 800 struct snd_pcm_substream *s; 807 snd_pcm_group_for_each(pos, substream) { 808 s = snd_pcm_group_substream_entry(pos); 801 snd_pcm_group_for_each_entry(s, substream) { 809 802 if (s == ensoniq->playback1_substream) { 810 803 what |= ES_P1_PAUSE; … … 829 822 { 830 823 unsigned int what = 0; 831 struct list_head *pos;832 824 struct snd_pcm_substream *s; 833 snd_pcm_group_for_each(pos, substream) { 834 s = snd_pcm_group_substream_entry(pos); 825 snd_pcm_group_for_each_entry(s, substream) { 835 826 if (s == ensoniq->playback1_substream) { 836 827 what |= ES_DAC1_EN; … … 1134 1125 &snd_es1370_hw_constraints_rates); 1135 1126 #else 1136 //snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,1137 //&snd_es1371_hw_constraints_dac_clock);1127 snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1128 &snd_es1371_hw_constraints_dac_clock); 1138 1129 #endif 1139 1130 return 0; … … 1157 1148 &snd_es1370_hw_constraints_clock); 1158 1149 #else 1159 //snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,1160 //&snd_es1371_hw_constraints_dac_clock);1150 snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1151 &snd_es1371_hw_constraints_dac_clock); 1161 1152 #endif 1162 1153 return 0; … … 1428 1419 .get = snd_es1371_spdif_get, .put = snd_es1371_spdif_put } 1429 1420 1430 static int snd_es1371_spdif_info(struct snd_kcontrol *kcontrol, 1431 struct snd_ctl_elem_info *uinfo) 1432 { 1433 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1434 uinfo->count = 1; 1435 uinfo->value.integer.min = 0; 1436 uinfo->value.integer.max = 1; 1437 return 0; 1438 } 1421 #define snd_es1371_spdif_info snd_ctl_boolean_mono_info 1439 1422 1440 1423 static int snd_es1371_spdif_get(struct snd_kcontrol *kcontrol, … … 1498 1481 1499 1482 1500 static int snd_es1373_rear_info(struct snd_kcontrol *kcontrol, 1501 struct snd_ctl_elem_info *uinfo) 1502 { 1503 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1504 uinfo->count = 1; 1505 uinfo->value.integer.min = 0; 1506 uinfo->value.integer.max = 1; 1507 return 0; 1508 } 1483 #define snd_es1373_rear_info snd_ctl_boolean_mono_info 1509 1484 1510 1485 static int snd_es1373_rear_get(struct snd_kcontrol *kcontrol, … … 1551 1526 }; 1552 1527 1553 static int snd_es1373_line_info(struct snd_kcontrol *kcontrol, 1554 struct snd_ctl_elem_info *uinfo) 1555 { 1556 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1557 uinfo->count = 1; 1558 uinfo->value.integer.min = 0; 1559 uinfo->value.integer.max = 1; 1560 return 0; 1561 } 1528 #define snd_es1373_line_info snd_ctl_boolean_mono_info 1562 1529 1563 1530 static int snd_es1373_line_get(struct snd_kcontrol *kcontrol, … … 1610 1577 } 1611 1578 1612 st atic struct{1579 struct es1371_quirk { 1613 1580 unsigned short vid; /* vendor ID */ 1614 1581 unsigned short did; /* device ID */ 1615 1582 unsigned char rev; /* revision */ 1616 } es1371_spdif_present[] __devinitdata = { 1583 }; 1584 1585 static int es1371_quirk_lookup(struct ensoniq *ensoniq, 1586 struct es1371_quirk *list) 1587 { 1588 while (list->vid != (unsigned short)PCI_ANY_ID) { 1589 if (ensoniq->pci->vendor == list->vid && 1590 ensoniq->pci->device == list->did && 1591 ensoniq->rev == list->rev) 1592 return 1; 1593 list++; 1594 } 1595 return 0; 1596 } 1597 1598 static struct es1371_quirk es1371_spdif_present[] __devinitdata = { 1617 1599 { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_C }, 1618 1600 { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_D }, … … 1623 1605 }; 1624 1606 1625 static int snd_ensoniq_1371_mixer(struct ensoniq * ensoniq, int has_spdif, int has_line) 1607 static struct snd_pci_quirk ens1373_line_quirk[] __devinitdata = { 1608 SND_PCI_QUIRK_ID(0x1274, 0x2000), /* GA-7DXR */ 1609 SND_PCI_QUIRK_ID(0x1458, 0xa000), /* GA-8IEXP */ 1610 {0} /* end */ 1611 }; 1612 1613 static int __devinit snd_ensoniq_1371_mixer(struct ensoniq *ensoniq, 1614 int has_spdif, int has_line) 1626 1615 { 1627 1616 struct snd_card *card = ensoniq->card; 1628 1617 struct snd_ac97_bus *pbus; 1629 1618 struct snd_ac97_template ac97; 1630 int err , idx;1619 int err; 1631 1620 static struct snd_ac97_bus_ops ops = { 1632 1621 .write = snd_es1371_codec_write, … … 1644 1633 if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) 1645 1634 return err; 1646 for (idx = 0; es1371_spdif_present[idx].vid != (unsigned short)PCI_ANY_ID; idx++) 1647 if ((ensoniq->pci->vendor == es1371_spdif_present[idx].vid && 1648 ensoniq->pci->device == es1371_spdif_present[idx].did && 1649 ensoniq->rev == es1371_spdif_present[idx].rev) || has_spdif > 0) { 1650 struct snd_kcontrol *kctl; 1651 int i, index = 0; 1652 1653 if (has_spdif < 0) 1654 break; 1655 1656 ensoniq->spdif_default = ensoniq->spdif_stream = 1657 SNDRV_PCM_DEFAULT_CON_SPDIF; 1658 outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS)); 1659 1660 if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SPDIF) 1661 index++; 1662 1663 for (i = 0; i < (int)ARRAY_SIZE(snd_es1371_mixer_spdif); i++) { 1664 kctl = snd_ctl_new1(&snd_es1371_mixer_spdif[i], ensoniq); 1665 if (! kctl) 1666 return -ENOMEM; 1667 kctl->id.index = index; 1668 if ((err = snd_ctl_add(card, kctl)) < 0) 1669 return err; 1670 } 1671 break; 1635 if (has_spdif > 0 || 1636 (!has_spdif && es1371_quirk_lookup(ensoniq, es1371_spdif_present))) { 1637 struct snd_kcontrol *kctl; 1638 int i, index = 0; 1639 1640 ensoniq->spdif_default = ensoniq->spdif_stream = 1641 SNDRV_PCM_DEFAULT_CON_SPDIF; 1642 outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS)); 1643 1644 if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SPDIF) 1645 index++; 1646 1647 for (i = 0; i < ARRAY_SIZE(snd_es1371_mixer_spdif); i++) { 1648 kctl = snd_ctl_new1(&snd_es1371_mixer_spdif[i], ensoniq); 1649 if (!kctl) 1650 return -ENOMEM; 1651 kctl->id.index = index; 1652 err = snd_ctl_add(card, kctl); 1653 if (err < 0) 1654 return err; 1672 1655 } 1656 } 1673 1657 if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SDAC) { 1674 1658 /* mirror rear to front speakers */ … … 1679 1663 return err; 1680 1664 } 1681 if (((ensoniq->subsystem_vendor_id == 0x1274) && 1682 (ensoniq->subsystem_device_id == 0x2000)) || /* GA-7DXR */ 1683 ((ensoniq->subsystem_vendor_id == 0x1458) && 1684 (ensoniq->subsystem_device_id == 0xa000)) || /* GA-8IEXP */ 1685 has_line > 0) { 1686 err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line, ensoniq)); 1665 if (has_line > 0 || 1666 snd_pci_quirk_lookup(ensoniq->pci, ens1373_line_quirk)) { 1667 err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line, 1668 ensoniq)); 1687 1669 if (err < 0) 1688 1670 return err; … … 1701 1683 .private_value = mask } 1702 1684 1703 static int snd_ensoniq_control_info(struct snd_kcontrol *kcontrol, 1704 struct snd_ctl_elem_info *uinfo) 1705 { 1706 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1707 uinfo->count = 1; 1708 uinfo->value.integer.min = 0; 1709 uinfo->value.integer.max = 1; 1710 return 0; 1711 } 1685 #define snd_ensoniq_control_info snd_ctl_boolean_mono_info 1712 1686 1713 1687 static int snd_ensoniq_control_get(struct snd_kcontrol *kcontrol, … … 1918 1892 1919 1893 if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry)) 1920 snd_info_set_text_ops(entry, ensoniq, 1024,snd_ensoniq_proc_read);1894 snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read); 1921 1895 } 1922 1896 … … 1959 1933 1960 1934 #ifdef CHIP1371 1961 static struct { 1962 unsigned short svid; /* subsystem vendor ID */ 1963 unsigned short sdid; /* subsystem device ID */ 1964 } es1371_amplifier_hack[] = { 1965 { .svid = 0x107b, .sdid = 0x2150 }, /* Gateway Solo 2150 */ 1966 { .svid = 0x13bd, .sdid = 0x100c }, /* EV1938 on Mebius PC-MJ100V */ 1967 { .svid = 0x1102, .sdid = 0x5938 }, /* Targa Xtender300 */ 1968 { .svid = 0x1102, .sdid = 0x8938 }, /* IPC Topnote G notebook */ 1969 { .svid = PCI_ANY_ID, .sdid = PCI_ANY_ID } 1970 }; 1971 static struct { 1972 unsigned short vid; /* vendor ID */ 1973 unsigned short did; /* device ID */ 1974 unsigned char rev; /* revision */ 1975 } es1371_ac97_reset_hack[] = { 1935 static struct snd_pci_quirk es1371_amplifier_hack[] __devinitdata = { 1936 SND_PCI_QUIRK_ID(0x107b, 0x2150), /* Gateway Solo 2150 */ 1937 SND_PCI_QUIRK_ID(0x13bd, 0x100c), /* EV1938 on Mebius PC-MJ100V */ 1938 SND_PCI_QUIRK_ID(0x1102, 0x5938), /* Targa Xtender300 */ 1939 SND_PCI_QUIRK_ID(0x1102, 0x8938), /* IPC Topnote G notebook */ 1940 {0} /* end */ 1941 }; 1942 1943 static struct es1371_quirk es1371_ac97_reset_hack[] = { 1976 1944 { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_C }, 1977 1945 { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_D }, … … 1987 1955 #ifdef CHIP1371 1988 1956 int idx; 1989 struct pci_dev *pci = ensoniq->pci;1990 1957 #endif 1991 1958 /* this code was part of snd_ensoniq_create before intruduction … … 2002 1969 outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL)); 2003 1970 outl(0, ES_REG(ensoniq, 1371_LEGACY)); 2004 for (idx = 0; es1371_ac97_reset_hack[idx].vid != (unsigned short)PCI_ANY_ID; idx++) 2005 if (pci->vendor == es1371_ac97_reset_hack[idx].vid && 2006 pci->device == es1371_ac97_reset_hack[idx].did && 2007 ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { 2008 outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); 2009 /* need to delay around 20ms(bleech) to give 2010 some CODECs enough time to wakeup */ 2011 msleep(20); 2012 break; 2013 } 1971 if (es1371_quirk_lookup(ensoniq, es1371_ac97_reset_hack)) { 1972 outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); 1973 /* need to delay around 20ms(bleech) to give 1974 some CODECs enough time to wakeup */ 1975 msleep(20); 1976 } 2014 1977 /* AC'97 warm reset to start the bitclk */ 2015 1978 outl(ensoniq->ctrl | ES_1371_SYNC_RES, ES_REG(ensoniq, CONTROL)); … … 2075 2038 snd_ak4531_suspend(ensoniq->u.es1370.ak4531); 2076 2039 #endif 2077 pci_set_power_state(pci, PCI_D3hot); 2040 2078 2041 pci_disable_device(pci); 2079 2042 pci_save_state(pci); 2043 pci_set_power_state(pci, pci_choose_state(pci, state)); 2080 2044 return 0; 2081 2045 } … … 2086 2050 struct ensoniq *ensoniq = card->private_data; 2087 2051 2052 pci_set_power_state(pci, PCI_D0); 2088 2053 pci_restore_state(pci); 2089 pci_enable_device(pci); 2090 pci_set_power_state(pci, PCI_D0); 2054 if (pci_enable_device(pci) < 0) { 2055 printk(KERN_ERR DRIVER_NAME ": pci_enable_device failed, " 2056 "disabling device\n"); 2057 snd_card_disconnect(card); 2058 return -EIO; 2059 } 2091 2060 pci_set_master(pci); 2092 2061 … … 2109 2078 { 2110 2079 struct ensoniq *ensoniq; 2111 unsigned short cmdw;2112 unsigned char cmdb;2113 #ifdef CHIP13712114 int idx;2115 #endif2116 2080 int err; 2117 2081 static struct snd_device_ops ops = { … … 2128 2092 } 2129 2093 spin_lock_init(&ensoniq->reg_lock); 2130 init_MUTEX(&ensoniq->src_mutex);2094 mutex_init(&ensoniq->src_mutex); 2131 2095 ensoniq->card = card; 2132 2096 ensoniq->pci = pci; … … 2138 2102 } 2139 2103 ensoniq->port = pci_resource_start(pci, 0); 2140 if (request_irq(pci->irq, snd_audiopci_interrupt, SA_INTERRUPT|SA_SHIRQ,2104 if (request_irq(pci->irq, snd_audiopci_interrupt, IRQF_SHARED, 2141 2105 "Ensoniq AudioPCI", ensoniq)) { 2142 2106 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); … … 2154 2118 #endif 2155 2119 pci_set_master(pci); 2156 pci_read_config_byte(pci, PCI_REVISION_ID, &cmdb); 2157 ensoniq->rev = cmdb; 2158 pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &cmdw); 2159 ensoniq->subsystem_vendor_id = cmdw; 2160 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &cmdw); 2161 ensoniq->subsystem_device_id = cmdw; 2120 #ifndef TARGET_OS2 2121 ensoniq->rev = pci->revision; 2122 #else 2123 ensoniq->rev = snd_pci_revision(pci); 2124 #endif 2162 2125 #ifdef CHIP1370 2163 2126 #if 0 … … 2172 2135 ensoniq->sctrl = 0; 2173 2136 ensoniq->cssr = 0; 2174 for (idx = 0; es1371_amplifier_hack[idx].svid != (unsigned short)PCI_ANY_ID; idx++) 2175 if (ensoniq->subsystem_vendor_id == es1371_amplifier_hack[idx].svid && 2176 ensoniq->subsystem_device_id == es1371_amplifier_hack[idx].sdid) { 2177 ensoniq->ctrl |= ES_1371_GPIO_OUT(1); /* turn amplifier on */ 2178 break; 2179 } 2180 for (idx = 0; es1371_ac97_reset_hack[idx].vid != (unsigned short)PCI_ANY_ID; idx++) 2181 if (pci->vendor == es1371_ac97_reset_hack[idx].vid && 2182 pci->device == es1371_ac97_reset_hack[idx].did && 2183 ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { 2184 ensoniq->cssr |= ES_1371_ST_AC97_RST; 2185 break; 2186 } 2137 if (snd_pci_quirk_lookup(pci, es1371_amplifier_hack)) 2138 ensoniq->ctrl |= ES_1371_GPIO_OUT(1); /* turn amplifier on */ 2139 2140 if (es1371_quirk_lookup(ensoniq, es1371_ac97_reset_hack)) 2141 ensoniq->cssr |= ES_1371_ST_AC97_RST; 2187 2142 #endif 2188 2143 … … 2407 2362 */ 2408 2363 2409 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id , struct pt_regs *regs)2364 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id) 2410 2365 { 2411 2366 struct ensoniq *ensoniq = dev_id; … … 2524 2479 .id_table = snd_audiopci_ids, 2525 2480 .probe = snd_audiopci_probe, 2526 .remove = snd_audiopci_remove,2481 .remove = __devexit_p(snd_audiopci_remove), 2527 2482 #ifdef CONFIG_PM 2528 2483 .suspend = snd_ensoniq_suspend,
Note:
See TracChangeset
for help on using the changeset viewer.