aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/intel8x0.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-10-04 02:46:51 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:17:16 -0500
commitb7fe46220487f684abc858865cff817389af5c76 (patch)
treed1eabbbdd0f686c87996133fd22ce2327da638c1 /sound/pci/intel8x0.c
parent4b0940f8117b6cdf7e7c27bdecc29931f18c81ed (diff)
[ALSA] highlanderize motherboard AC97/HDA drivers
Remove the code for supporting eight cards from the integrated controller drivers because There Can Be Only One controller of each type per mainboard. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/pci/intel8x0.c')
-rw-r--r--sound/pci/intel8x0.c58
1 files changed, 21 insertions, 37 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 0d11cf7d569a..bd9563c8b11e 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -64,34 +64,27 @@ MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
64 "{AMD,AMD8111}," 64 "{AMD,AMD8111},"
65 "{ALI,M5455}}"); 65 "{ALI,M5455}}");
66 66
67static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 67static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
68static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 68static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
69static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 69static int ac97_clock = 0;
70static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 70static char *ac97_quirk;
71static char *ac97_quirk[SNDRV_CARDS]; 71static int buggy_semaphore;
72static int buggy_semaphore[SNDRV_CARDS]; 72static int buggy_irq;
73static int buggy_irq[SNDRV_CARDS]; 73static int xbox;
74static int xbox[SNDRV_CARDS]; 74
75 75module_param(index, int, 0444);
76#ifdef SUPPORT_MIDI
77static int mpu_port[SNDRV_CARDS]; /* disabled */
78#endif
79
80module_param_array(index, int, NULL, 0444);
81MODULE_PARM_DESC(index, "Index value for Intel i8x0 soundcard."); 76MODULE_PARM_DESC(index, "Index value for Intel i8x0 soundcard.");
82module_param_array(id, charp, NULL, 0444); 77module_param(id, charp, 0444);
83MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard."); 78MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard.");
84module_param_array(enable, bool, NULL, 0444); 79module_param(ac97_clock, int, 0444);
85MODULE_PARM_DESC(enable, "Enable Intel i8x0 soundcard.");
86module_param_array(ac97_clock, int, NULL, 0444);
87MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); 80MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
88module_param_array(ac97_quirk, charp, NULL, 0444); 81module_param(ac97_quirk, charp, 0444);
89MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 82MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
90module_param_array(buggy_semaphore, bool, NULL, 0444); 83module_param(buggy_semaphore, bool, 0444);
91MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores."); 84MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores.");
92module_param_array(buggy_irq, bool, NULL, 0444); 85module_param(buggy_irq, bool, 0444);
93MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards."); 86MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards.");
94module_param_array(xbox, bool, NULL, 0444); 87module_param(xbox, bool, 0444);
95MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection."); 88MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection.");
96 89
97/* 90/*
@@ -2781,20 +2774,12 @@ static struct shortname_table {
2781static int __devinit snd_intel8x0_probe(struct pci_dev *pci, 2774static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2782 const struct pci_device_id *pci_id) 2775 const struct pci_device_id *pci_id)
2783{ 2776{
2784 static int dev;
2785 snd_card_t *card; 2777 snd_card_t *card;
2786 intel8x0_t *chip; 2778 intel8x0_t *chip;
2787 int err; 2779 int err;
2788 struct shortname_table *name; 2780 struct shortname_table *name;
2789 2781
2790 if (dev >= SNDRV_CARDS) 2782 card = snd_card_new(index, id, THIS_MODULE, 0);
2791 return -ENODEV;
2792 if (!enable[dev]) {
2793 dev++;
2794 return -ENOENT;
2795 }
2796
2797 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
2798 if (card == NULL) 2783 if (card == NULL)
2799 return -ENOMEM; 2784 return -ENOMEM;
2800 2785
@@ -2819,16 +2804,16 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2819 } 2804 }
2820 2805
2821 if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, 2806 if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data,
2822 buggy_semaphore[dev], &chip)) < 0) { 2807 buggy_semaphore, &chip)) < 0) {
2823 snd_card_free(card); 2808 snd_card_free(card);
2824 return err; 2809 return err;
2825 } 2810 }
2826 if (buggy_irq[dev]) 2811 if (buggy_irq)
2827 chip->buggy_irq = 1; 2812 chip->buggy_irq = 1;
2828 if (xbox[dev]) 2813 if (xbox)
2829 chip->xbox = 1; 2814 chip->xbox = 1;
2830 2815
2831 if ((err = snd_intel8x0_mixer(chip, ac97_clock[dev], ac97_quirk[dev])) < 0) { 2816 if ((err = snd_intel8x0_mixer(chip, ac97_clock, ac97_quirk)) < 0) {
2832 snd_card_free(card); 2817 snd_card_free(card);
2833 return err; 2818 return err;
2834 } 2819 }
@@ -2843,7 +2828,7 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2843 "%s with %s at %#lx, irq %i", card->shortname, 2828 "%s with %s at %#lx, irq %i", card->shortname,
2844 snd_ac97_get_short_name(chip->ac97[0]), chip->addr, chip->irq); 2829 snd_ac97_get_short_name(chip->ac97[0]), chip->addr, chip->irq);
2845 2830
2846 if (! ac97_clock[dev]) 2831 if (! ac97_clock)
2847 intel8x0_measure_ac97_clock(chip); 2832 intel8x0_measure_ac97_clock(chip);
2848 2833
2849 if ((err = snd_card_register(card)) < 0) { 2834 if ((err = snd_card_register(card)) < 0) {
@@ -2851,7 +2836,6 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2851 return err; 2836 return err;
2852 } 2837 }
2853 pci_set_drvdata(pci, card); 2838 pci_set_drvdata(pci, card);
2854 dev++;
2855 return 0; 2839 return 0;
2856} 2840}
2857 2841