diff options
Diffstat (limited to 'sound/pci/intel8x0.c')
| -rw-r--r-- | sound/pci/intel8x0.c | 91 |
1 files changed, 26 insertions, 65 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 7b548416dcef..1a96198a17ae 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
| @@ -69,6 +69,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | |||
| 69 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 69 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
| 70 | static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; | 70 | static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; |
| 71 | static char *ac97_quirk[SNDRV_CARDS]; | 71 | static char *ac97_quirk[SNDRV_CARDS]; |
| 72 | static int buggy_semaphore[SNDRV_CARDS]; | ||
| 72 | static int buggy_irq[SNDRV_CARDS]; | 73 | static int buggy_irq[SNDRV_CARDS]; |
| 73 | static int xbox[SNDRV_CARDS]; | 74 | static int xbox[SNDRV_CARDS]; |
| 74 | 75 | ||
| @@ -86,6 +87,8 @@ module_param_array(ac97_clock, int, NULL, 0444); | |||
| 86 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); | 87 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); |
| 87 | module_param_array(ac97_quirk, charp, NULL, 0444); | 88 | module_param_array(ac97_quirk, charp, NULL, 0444); |
| 88 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); | 89 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); |
| 90 | module_param_array(buggy_semaphore, bool, NULL, 0444); | ||
| 91 | MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores."); | ||
| 89 | module_param_array(buggy_irq, bool, NULL, 0444); | 92 | module_param_array(buggy_irq, bool, NULL, 0444); |
| 90 | MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards."); | 93 | MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards."); |
| 91 | module_param_array(xbox, bool, NULL, 0444); | 94 | module_param_array(xbox, bool, NULL, 0444); |
| @@ -94,62 +97,6 @@ MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 c | |||
| 94 | /* | 97 | /* |
| 95 | * Direct registers | 98 | * Direct registers |
| 96 | */ | 99 | */ |
| 97 | |||
| 98 | #ifndef PCI_DEVICE_ID_INTEL_82801 | ||
| 99 | #define PCI_DEVICE_ID_INTEL_82801 0x2415 | ||
| 100 | #endif | ||
| 101 | #ifndef PCI_DEVICE_ID_INTEL_82901 | ||
| 102 | #define PCI_DEVICE_ID_INTEL_82901 0x2425 | ||
| 103 | #endif | ||
| 104 | #ifndef PCI_DEVICE_ID_INTEL_82801BA | ||
| 105 | #define PCI_DEVICE_ID_INTEL_82801BA 0x2445 | ||
| 106 | #endif | ||
| 107 | #ifndef PCI_DEVICE_ID_INTEL_440MX | ||
| 108 | #define PCI_DEVICE_ID_INTEL_440MX 0x7195 | ||
| 109 | #endif | ||
| 110 | #ifndef PCI_DEVICE_ID_INTEL_ICH3 | ||
| 111 | #define PCI_DEVICE_ID_INTEL_ICH3 0x2485 | ||
| 112 | #endif | ||
| 113 | #ifndef PCI_DEVICE_ID_INTEL_ICH4 | ||
| 114 | #define PCI_DEVICE_ID_INTEL_ICH4 0x24c5 | ||
| 115 | #endif | ||
| 116 | #ifndef PCI_DEVICE_ID_INTEL_ICH5 | ||
| 117 | #define PCI_DEVICE_ID_INTEL_ICH5 0x24d5 | ||
| 118 | #endif | ||
| 119 | #ifndef PCI_DEVICE_ID_INTEL_ESB_5 | ||
| 120 | #define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 | ||
| 121 | #endif | ||
| 122 | #ifndef PCI_DEVICE_ID_INTEL_ICH6_18 | ||
| 123 | #define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e | ||
| 124 | #endif | ||
| 125 | #ifndef PCI_DEVICE_ID_INTEL_ICH7_20 | ||
| 126 | #define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de | ||
| 127 | #endif | ||
| 128 | #ifndef PCI_DEVICE_ID_INTEL_ESB2_14 | ||
| 129 | #define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698 | ||
| 130 | #endif | ||
| 131 | #ifndef PCI_DEVICE_ID_SI_7012 | ||
| 132 | #define PCI_DEVICE_ID_SI_7012 0x7012 | ||
| 133 | #endif | ||
| 134 | #ifndef PCI_DEVICE_ID_NVIDIA_MCP_AUDIO | ||
| 135 | #define PCI_DEVICE_ID_NVIDIA_MCP_AUDIO 0x01b1 | ||
| 136 | #endif | ||
| 137 | #ifndef PCI_DEVICE_ID_NVIDIA_CK804_AUDIO | ||
| 138 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 | ||
| 139 | #endif | ||
| 140 | #ifndef PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO | ||
| 141 | #define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a | ||
| 142 | #endif | ||
| 143 | #ifndef PCI_DEVICE_ID_NVIDIA_CK8_AUDIO | ||
| 144 | #define PCI_DEVICE_ID_NVIDIA_CK8_AUDIO 0x008a | ||
| 145 | #endif | ||
| 146 | #ifndef PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO | ||
| 147 | #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da | ||
| 148 | #endif | ||
| 149 | #ifndef PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO | ||
| 150 | #define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea | ||
| 151 | #endif | ||
| 152 | |||
| 153 | enum { DEVICE_INTEL, DEVICE_INTEL_ICH4, DEVICE_SIS, DEVICE_ALI, DEVICE_NFORCE }; | 100 | enum { DEVICE_INTEL, DEVICE_INTEL_ICH4, DEVICE_SIS, DEVICE_ALI, DEVICE_NFORCE }; |
| 154 | 101 | ||
| 155 | #define ICHREG(x) ICH_REG_##x | 102 | #define ICHREG(x) ICH_REG_##x |
| @@ -423,6 +370,7 @@ struct _snd_intel8x0 { | |||
| 423 | unsigned fix_nocache: 1; /* workaround for 440MX */ | 370 | unsigned fix_nocache: 1; /* workaround for 440MX */ |
| 424 | unsigned buggy_irq: 1; /* workaround for buggy mobos */ | 371 | unsigned buggy_irq: 1; /* workaround for buggy mobos */ |
| 425 | unsigned xbox: 1; /* workaround for Xbox AC'97 detection */ | 372 | unsigned xbox: 1; /* workaround for Xbox AC'97 detection */ |
| 373 | unsigned buggy_semaphore: 1; /* workaround for buggy codec semaphore */ | ||
| 426 | 374 | ||
| 427 | int spdif_idx; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */ | 375 | int spdif_idx; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */ |
| 428 | unsigned int sdm_saved; /* SDM reg value */ | 376 | unsigned int sdm_saved; /* SDM reg value */ |
| @@ -577,6 +525,9 @@ static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec) | |||
| 577 | if ((igetdword(chip, ICHREG(GLOB_STA)) & codec) == 0) | 525 | if ((igetdword(chip, ICHREG(GLOB_STA)) & codec) == 0) |
| 578 | return -EIO; | 526 | return -EIO; |
| 579 | 527 | ||
| 528 | if (chip->buggy_semaphore) | ||
| 529 | return 0; /* just ignore ... */ | ||
| 530 | |||
| 580 | /* Anyone holding a semaphore for 1 msec should be shot... */ | 531 | /* Anyone holding a semaphore for 1 msec should be shot... */ |
| 581 | time = 100; | 532 | time = 100; |
| 582 | do { | 533 | do { |
| @@ -1759,6 +1710,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
| 1759 | .type = AC97_TUNE_ALC_JACK | 1710 | .type = AC97_TUNE_ALC_JACK |
| 1760 | }, | 1711 | }, |
| 1761 | { | 1712 | { |
| 1713 | .subvendor = 0x1014, | ||
| 1714 | .subdevice = 0x0267, | ||
| 1715 | .name = "IBM NetVista A30p", /* AD1981B */ | ||
| 1716 | .type = AC97_TUNE_HP_ONLY | ||
| 1717 | }, | ||
| 1718 | { | ||
| 1762 | .subvendor = 0x1028, | 1719 | .subvendor = 0x1028, |
| 1763 | .subdevice = 0x00d8, | 1720 | .subdevice = 0x00d8, |
| 1764 | .name = "Dell Precision 530", /* AD1885 */ | 1721 | .name = "Dell Precision 530", /* AD1885 */ |
| @@ -2599,6 +2556,7 @@ struct ich_reg_info { | |||
| 2599 | static int __devinit snd_intel8x0_create(snd_card_t * card, | 2556 | static int __devinit snd_intel8x0_create(snd_card_t * card, |
| 2600 | struct pci_dev *pci, | 2557 | struct pci_dev *pci, |
| 2601 | unsigned long device_type, | 2558 | unsigned long device_type, |
| 2559 | int buggy_sem, | ||
| 2602 | intel8x0_t ** r_intel8x0) | 2560 | intel8x0_t ** r_intel8x0) |
| 2603 | { | 2561 | { |
| 2604 | intel8x0_t *chip; | 2562 | intel8x0_t *chip; |
| @@ -2646,7 +2604,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, | |||
| 2646 | if ((err = pci_enable_device(pci)) < 0) | 2604 | if ((err = pci_enable_device(pci)) < 0) |
| 2647 | return err; | 2605 | return err; |
| 2648 | 2606 | ||
| 2649 | chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); | 2607 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
| 2650 | if (chip == NULL) { | 2608 | if (chip == NULL) { |
| 2651 | pci_disable_device(pci); | 2609 | pci_disable_device(pci); |
| 2652 | return -ENOMEM; | 2610 | return -ENOMEM; |
| @@ -2656,6 +2614,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, | |||
| 2656 | chip->card = card; | 2614 | chip->card = card; |
| 2657 | chip->pci = pci; | 2615 | chip->pci = pci; |
| 2658 | chip->irq = -1; | 2616 | chip->irq = -1; |
| 2617 | chip->buggy_semaphore = buggy_sem; | ||
| 2659 | 2618 | ||
| 2660 | if (pci->vendor == PCI_VENDOR_ID_INTEL && | 2619 | if (pci->vendor == PCI_VENDOR_ID_INTEL && |
| 2661 | pci->device == PCI_DEVICE_ID_INTEL_440MX) | 2620 | pci->device == PCI_DEVICE_ID_INTEL_440MX) |
| @@ -2795,19 +2754,19 @@ static struct shortname_table { | |||
| 2795 | unsigned int id; | 2754 | unsigned int id; |
| 2796 | const char *s; | 2755 | const char *s; |
| 2797 | } shortnames[] __devinitdata = { | 2756 | } shortnames[] __devinitdata = { |
| 2798 | { PCI_DEVICE_ID_INTEL_82801, "Intel 82801AA-ICH" }, | 2757 | { PCI_DEVICE_ID_INTEL_82801AA_5, "Intel 82801AA-ICH" }, |
| 2799 | { PCI_DEVICE_ID_INTEL_82901, "Intel 82901AB-ICH0" }, | 2758 | { PCI_DEVICE_ID_INTEL_82801AB_5, "Intel 82901AB-ICH0" }, |
| 2800 | { PCI_DEVICE_ID_INTEL_82801BA, "Intel 82801BA-ICH2" }, | 2759 | { PCI_DEVICE_ID_INTEL_82801BA_4, "Intel 82801BA-ICH2" }, |
| 2801 | { PCI_DEVICE_ID_INTEL_440MX, "Intel 440MX" }, | 2760 | { PCI_DEVICE_ID_INTEL_440MX, "Intel 440MX" }, |
| 2802 | { PCI_DEVICE_ID_INTEL_ICH3, "Intel 82801CA-ICH3" }, | 2761 | { PCI_DEVICE_ID_INTEL_82801CA_5, "Intel 82801CA-ICH3" }, |
| 2803 | { PCI_DEVICE_ID_INTEL_ICH4, "Intel 82801DB-ICH4" }, | 2762 | { PCI_DEVICE_ID_INTEL_82801DB_5, "Intel 82801DB-ICH4" }, |
| 2804 | { PCI_DEVICE_ID_INTEL_ICH5, "Intel ICH5" }, | 2763 | { PCI_DEVICE_ID_INTEL_82801EB_5, "Intel ICH5" }, |
| 2805 | { PCI_DEVICE_ID_INTEL_ESB_5, "Intel 6300ESB" }, | 2764 | { PCI_DEVICE_ID_INTEL_ESB_5, "Intel 6300ESB" }, |
| 2806 | { PCI_DEVICE_ID_INTEL_ICH6_18, "Intel ICH6" }, | 2765 | { PCI_DEVICE_ID_INTEL_ICH6_18, "Intel ICH6" }, |
| 2807 | { PCI_DEVICE_ID_INTEL_ICH7_20, "Intel ICH7" }, | 2766 | { PCI_DEVICE_ID_INTEL_ICH7_20, "Intel ICH7" }, |
| 2808 | { PCI_DEVICE_ID_INTEL_ESB2_14, "Intel ESB2" }, | 2767 | { PCI_DEVICE_ID_INTEL_ESB2_14, "Intel ESB2" }, |
| 2809 | { PCI_DEVICE_ID_SI_7012, "SiS SI7012" }, | 2768 | { PCI_DEVICE_ID_SI_7012, "SiS SI7012" }, |
| 2810 | { PCI_DEVICE_ID_NVIDIA_MCP_AUDIO, "NVidia nForce" }, | 2769 | { PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO, "NVidia nForce" }, |
| 2811 | { PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO, "NVidia nForce2" }, | 2770 | { PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO, "NVidia nForce2" }, |
| 2812 | { PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO, "NVidia nForce3" }, | 2771 | { PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO, "NVidia nForce3" }, |
| 2813 | { PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO, "NVidia CK8S" }, | 2772 | { PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO, "NVidia CK8S" }, |
| @@ -2860,7 +2819,8 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci, | |||
| 2860 | } | 2819 | } |
| 2861 | } | 2820 | } |
| 2862 | 2821 | ||
| 2863 | if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, &chip)) < 0) { | 2822 | if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, |
| 2823 | buggy_semaphore[dev], &chip)) < 0) { | ||
| 2864 | snd_card_free(card); | 2824 | snd_card_free(card); |
| 2865 | return err; | 2825 | return err; |
| 2866 | } | 2826 | } |
| @@ -2904,6 +2864,7 @@ static void __devexit snd_intel8x0_remove(struct pci_dev *pci) | |||
| 2904 | 2864 | ||
| 2905 | static struct pci_driver driver = { | 2865 | static struct pci_driver driver = { |
| 2906 | .name = "Intel ICH", | 2866 | .name = "Intel ICH", |
| 2867 | .owner = THIS_MODULE, | ||
| 2907 | .id_table = snd_intel8x0_ids, | 2868 | .id_table = snd_intel8x0_ids, |
| 2908 | .probe = snd_intel8x0_probe, | 2869 | .probe = snd_intel8x0_probe, |
| 2909 | .remove = __devexit_p(snd_intel8x0_remove), | 2870 | .remove = __devexit_p(snd_intel8x0_remove), |
