@@ -69,6 +69,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
6969static int enable [SNDRV_CARDS ] = SNDRV_DEFAULT_ENABLE_PNP ; /* Enable this card */
7070static int ac97_clock [SNDRV_CARDS ] = {[0 ... (SNDRV_CARDS - 1 )] = 0 };
7171static char * ac97_quirk [SNDRV_CARDS ];
72+ static int buggy_semaphore [SNDRV_CARDS ];
7273static int buggy_irq [SNDRV_CARDS ];
7374static int xbox [SNDRV_CARDS ];
7475
@@ -86,6 +87,8 @@ module_param_array(ac97_clock, int, NULL, 0444);
8687MODULE_PARM_DESC (ac97_clock , "AC'97 codec clock (0 = auto-detect)." );
8788module_param_array (ac97_quirk , charp , NULL , 0444 );
8889MODULE_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." );
8992module_param_array (buggy_irq , bool , NULL , 0444 );
9093MODULE_PARM_DESC (buggy_irq , "Enable workaround for buggy interrupts on some motherboards." );
9194module_param_array (xbox , bool , NULL , 0444 );
@@ -367,6 +370,7 @@ struct _snd_intel8x0 {
367370 unsigned fix_nocache : 1 ; /* workaround for 440MX */
368371 unsigned buggy_irq : 1 ; /* workaround for buggy mobos */
369372 unsigned xbox : 1 ; /* workaround for Xbox AC'97 detection */
373+ unsigned buggy_semaphore : 1 ; /* workaround for buggy codec semaphore */
370374
371375 int spdif_idx ; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */
372376 unsigned int sdm_saved ; /* SDM reg value */
@@ -521,6 +525,9 @@ static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec)
521525 if ((igetdword (chip , ICHREG (GLOB_STA )) & codec ) == 0 )
522526 return - EIO ;
523527
528+ if (chip -> buggy_semaphore )
529+ return 0 ; /* just ignore ... */
530+
524531 /* Anyone holding a semaphore for 1 msec should be shot... */
525532 time = 100 ;
526533 do {
@@ -2549,6 +2556,7 @@ struct ich_reg_info {
25492556static int __devinit snd_intel8x0_create (snd_card_t * card ,
25502557 struct pci_dev * pci ,
25512558 unsigned long device_type ,
2559+ int buggy_sem ,
25522560 intel8x0_t * * r_intel8x0 )
25532561{
25542562 intel8x0_t * chip ;
@@ -2606,6 +2614,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
26062614 chip -> card = card ;
26072615 chip -> pci = pci ;
26082616 chip -> irq = -1 ;
2617+ chip -> buggy_semaphore = buggy_sem ;
26092618
26102619 if (pci -> vendor == PCI_VENDOR_ID_INTEL &&
26112620 pci -> device == PCI_DEVICE_ID_INTEL_440MX )
@@ -2810,7 +2819,8 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
28102819 }
28112820 }
28122821
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 ) {
28142824 snd_card_free (card );
28152825 return err ;
28162826 }
0 commit comments