diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-08 13:54:17 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 04:47:47 -0400 |
commit | a06147d22865e9becb2918baec59d618fb09d896 (patch) | |
tree | 8bcfdd6f6a4b2e57955e670828e1540f49a5aa0e | |
parent | 10f69f9e42833b82288882d10901dc86adc3e473 (diff) |
[ALSA] intel8x0 - Add buggy_semaphore option
Documentation,Intel8x0 driver
Added buggy_semaphore module option to snd-intel8x0 driver
for a workaround for hardwards with buggy codec semaphores.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | Documentation/sound/alsa/ALSA-Configuration.txt | 6 | ||||
-rw-r--r-- | sound/pci/intel8x0.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 57e82a5fae71..13cba955cb5a 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -805,7 +805,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
805 | ac97_quirk - AC'97 workaround for strange hardware | 805 | ac97_quirk - AC'97 workaround for strange hardware |
806 | See "AC97 Quirk Option" section below. | 806 | See "AC97 Quirk Option" section below. |
807 | buggy_irq - Enable workaround for buggy interrupts on some | 807 | buggy_irq - Enable workaround for buggy interrupts on some |
808 | motherboards (default off) | 808 | motherboards (default yes on nForce chips, |
809 | otherwise off) | ||
810 | buggy_semaphore - Enable workaround for hardwares with buggy | ||
811 | semaphores (e.g. on some ASUS laptops) | ||
812 | (default off) | ||
809 | 813 | ||
810 | Module supports autoprobe and multiple bus-master chips (max 8). | 814 | Module supports autoprobe and multiple bus-master chips (max 8). |
811 | 815 | ||
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index b96f87e73398..47965dfcbee9 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); |
@@ -367,6 +370,7 @@ struct _snd_intel8x0 { | |||
367 | unsigned fix_nocache: 1; /* workaround for 440MX */ | 370 | unsigned fix_nocache: 1; /* workaround for 440MX */ |
368 | unsigned buggy_irq: 1; /* workaround for buggy mobos */ | 371 | unsigned buggy_irq: 1; /* workaround for buggy mobos */ |
369 | 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 */ | ||
370 | 374 | ||
371 | 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 */ |
372 | unsigned int sdm_saved; /* SDM reg value */ | 376 | unsigned int sdm_saved; /* SDM reg value */ |
@@ -521,6 +525,9 @@ static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec) | |||
521 | if ((igetdword(chip, ICHREG(GLOB_STA)) & codec) == 0) | 525 | if ((igetdword(chip, ICHREG(GLOB_STA)) & codec) == 0) |
522 | return -EIO; | 526 | return -EIO; |
523 | 527 | ||
528 | if (chip->buggy_semaphore) | ||
529 | return 0; /* just ignore ... */ | ||
530 | |||
524 | /* Anyone holding a semaphore for 1 msec should be shot... */ | 531 | /* Anyone holding a semaphore for 1 msec should be shot... */ |
525 | time = 100; | 532 | time = 100; |
526 | do { | 533 | do { |
@@ -2549,6 +2556,7 @@ struct ich_reg_info { | |||
2549 | static int __devinit snd_intel8x0_create(snd_card_t * card, | 2556 | static int __devinit snd_intel8x0_create(snd_card_t * card, |
2550 | struct pci_dev *pci, | 2557 | struct pci_dev *pci, |
2551 | unsigned long device_type, | 2558 | unsigned long device_type, |
2559 | int buggy_sem, | ||
2552 | intel8x0_t ** r_intel8x0) | 2560 | intel8x0_t ** r_intel8x0) |
2553 | { | 2561 | { |
2554 | intel8x0_t *chip; | 2562 | intel8x0_t *chip; |
@@ -2606,6 +2614,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, | |||
2606 | chip->card = card; | 2614 | chip->card = card; |
2607 | chip->pci = pci; | 2615 | chip->pci = pci; |
2608 | chip->irq = -1; | 2616 | chip->irq = -1; |
2617 | chip->buggy_semaphore = buggy_sem; | ||
2609 | 2618 | ||
2610 | if (pci->vendor == PCI_VENDOR_ID_INTEL && | 2619 | if (pci->vendor == PCI_VENDOR_ID_INTEL && |
2611 | pci->device == PCI_DEVICE_ID_INTEL_440MX) | 2620 | pci->device == PCI_DEVICE_ID_INTEL_440MX) |
@@ -2810,7 +2819,8 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci, | |||
2810 | } | 2819 | } |
2811 | } | 2820 | } |
2812 | 2821 | ||
2813 | 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) { | ||
2814 | snd_card_free(card); | 2824 | snd_card_free(card); |
2815 | return err; | 2825 | return err; |
2816 | } | 2826 | } |