Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7fe4622 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela
Browse files

[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: default avatarClemens Ladisch <clemens@ladisch.de>
parent 4b0940f8
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
			  See "AC97 Quirk Option" section below.
    spdif_aclink	- S/PDIF transfer over AC-link (default = 1)

    This module supports up to 8 cards and autoprobe.
    This module supports one card and autoprobe.

    ATI IXP has two different methods to control SPDIF output.  One is
    over AC-link and another is over the "direct" SPDIF output.  The
@@ -218,7 +218,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

    Module for ATI IXP 150/200/250 AC97 modem controllers.

    Module supports up to 8 cards.
    This module supports one card and autoprobe.

    Note: The default index value of this module is -2, i.e. the first
          slot is excluded.
@@ -637,7 +637,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    model	- force the model name
    position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)

    Module supports up to 8 cards.
    This module supports one card and autoprobe.

    Each codec may have a model table for different configurations.
    If your machine isn't listed there, the default (usually minimal)
@@ -815,7 +815,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
		    semaphores (e.g. on some ASUS laptops)
		    (default off)

    Module supports autoprobe and multiple bus-master chips (max 8).
    This module supports one chip and autoprobe.

    Note: the latest driver supports auto-detection of chip clock.
    if you still encounter too fast playback, specify the clock
@@ -834,7 +834,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

    ac97_clock	  - AC'97 codec clock base (0 = auto-detect)

    This module supports up to 8 cards and autoprobe.
    This module supports one card and autoprobe.

    Note: The default index value of this module is -2, i.e. the first
          slot is excluded.
@@ -1314,7 +1314,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    ac97_quirk  - AC'97 workaround for strange hardware
		  See "AC97 Quirk Option" section below.

    Module supports autoprobe and multiple bus-master chips (max 8).
    This module supports one chip and autoprobe.

    Note: on some SMP motherboards like MSI 694D the interrupts might
          not be generated properly.  In such a case, please try to
@@ -1356,7 +1356,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

    ac97_clock	- AC'97 codec clock base (default 48000Hz)

    Module supports up to 8 cards.
    This module supports one card and autoprobe.

    Note: The default index value of this module is -2, i.e. the first
          slot is excluded.
+15 −27
Original line number Diff line number Diff line
@@ -39,24 +39,21 @@ MODULE_DESCRIPTION("ATI IXP AC97 controller");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400}}");

static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
static char *ac97_quirk[SNDRV_CARDS];
static int spdif_aclink[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};

module_param_array(index, int, NULL, 0444);
static int index = SNDRV_DEFAULT_IDX1;	/* Index 0-MAX */
static char *id = SNDRV_DEFAULT_STR1;	/* ID for this card */
static int ac97_clock = 48000;
static char *ac97_quirk;
static int spdif_aclink = 1;

module_param(index, int, 0444);
MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
module_param_array(id, charp, NULL, 0444);
module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for ATI IXP controller.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
module_param_array(ac97_clock, int, NULL, 0444);
module_param(ac97_clock, int, 0444);
MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
module_param_array(ac97_quirk, charp, NULL, 0444);
module_param(ac97_quirk, charp, 0444);
MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
module_param_array(spdif_aclink, bool, NULL, 0444);
module_param(spdif_aclink, bool, 0444);
MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");


@@ -1578,26 +1575,18 @@ static int __devinit snd_atiixp_create(snd_card_t *card,
static int __devinit snd_atiixp_probe(struct pci_dev *pci,
				     const struct pci_device_id *pci_id)
{
	static int dev;
	snd_card_t *card;
	atiixp_t *chip;
	unsigned char revision;
	int err;

	if (dev >= SNDRV_CARDS)
		return -ENODEV;
	if (!enable[dev]) {
		dev++;
		return -ENOENT;
	}

	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
	card = snd_card_new(index, id, THIS_MODULE, 0);
	if (card == NULL)
		return -ENOMEM;

	pci_read_config_byte(pci, PCI_REVISION_ID, &revision);

	strcpy(card->driver, spdif_aclink[dev] ? "ATIIXP" : "ATIIXP-SPDMA");
	strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
	strcpy(card->shortname, "ATI IXP");
	if ((err = snd_atiixp_create(card, pci, &chip)) < 0)
		goto __error;
@@ -1605,9 +1594,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
	if ((err = snd_atiixp_aclink_reset(chip)) < 0)
		goto __error;

	chip->spdif_over_aclink = spdif_aclink[dev];
	chip->spdif_over_aclink = spdif_aclink;

	if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev], ac97_quirk[dev])) < 0)
	if ((err = snd_atiixp_mixer_new(chip, ac97_clock, ac97_quirk)) < 0)
		goto __error;

	if ((err = snd_atiixp_pcm_new(chip)) < 0)
@@ -1628,7 +1617,6 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
		goto __error;

	pci_set_drvdata(pci, card);
	dev++;
	return 0;

 __error:
+8 −20
Original line number Diff line number Diff line
@@ -39,18 +39,15 @@ MODULE_DESCRIPTION("ATI IXP MC97 controller");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}");

static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
static int index = -2; /* Exclude the first card */
static char *id = SNDRV_DEFAULT_STR1;	/* ID for this card */
static int ac97_clock = 48000;

module_param_array(index, int, NULL, 0444);
module_param(index, int, 0444);
MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
module_param_array(id, charp, NULL, 0444);
module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for ATI IXP controller.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
module_param_array(ac97_clock, int, NULL, 0444);
module_param(ac97_clock, int, 0444);
MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");


@@ -1256,20 +1253,12 @@ static int __devinit snd_atiixp_create(snd_card_t *card,
static int __devinit snd_atiixp_probe(struct pci_dev *pci,
				      const struct pci_device_id *pci_id)
{
	static int dev;
	snd_card_t *card;
	atiixp_t *chip;
	unsigned char revision;
	int err;

	if (dev >= SNDRV_CARDS)
		return -ENODEV;
	if (!enable[dev]) {
		dev++;
		return -ENOENT;
	}

	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
	card = snd_card_new(index, id, THIS_MODULE, 0);
	if (card == NULL)
		return -ENOMEM;

@@ -1283,7 +1272,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
	if ((err = snd_atiixp_aclink_reset(chip)) < 0)
		goto __error;

	if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev])) < 0)
	if ((err = snd_atiixp_mixer_new(chip, ac97_clock)) < 0)
		goto __error;

	if ((err = snd_atiixp_pcm_new(chip)) < 0)
@@ -1302,7 +1291,6 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
		goto __error;

	pci_set_drvdata(pci, card);
	dev++;
	return 0;

 __error:
+11 −23
Original line number Diff line number Diff line
@@ -47,21 +47,18 @@
#include "hda_codec.h"


static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
static char *model[SNDRV_CARDS];
static int position_fix[SNDRV_CARDS];
static int index = SNDRV_DEFAULT_IDX1;
static char *id = SNDRV_DEFAULT_STR1;
static char *model;
static int position_fix;

module_param_array(index, int, NULL, 0444);
module_param(index, int, 0444);
MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
module_param_array(id, charp, NULL, 0444);
module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for Intel HD audio interface.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable Intel HD audio interface.");
module_param_array(model, charp, NULL, 0444);
module_param(model, charp, 0444);
MODULE_PARM_DESC(model, "Use the given board model.");
module_param_array(position_fix, int, NULL, 0444);
module_param(position_fix, int, 0444);
MODULE_PARM_DESC(position_fix, "Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size).");

MODULE_LICENSE("GPL");
@@ -1544,32 +1541,24 @@ static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci,

static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
{
	static int dev;
	snd_card_t *card;
	azx_t *chip;
	int err = 0;

	if (dev >= SNDRV_CARDS)
		return -ENODEV;
	if (! enable[dev]) {
		dev++;
		return -ENOENT;
	}

	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
	card = snd_card_new(index, id, THIS_MODULE, 0);
	if (NULL == card) {
		snd_printk(KERN_ERR SFX "Error creating card!\n");
		return -ENOMEM;
	}

	if ((err = azx_create(card, pci, position_fix[dev], pci_id->driver_data,
	if ((err = azx_create(card, pci, position_fix, pci_id->driver_data,
			      &chip)) < 0) {
		snd_card_free(card);
		return err;
	}

	/* create codec instances */
	if ((err = azx_codec_create(chip, model[dev])) < 0) {
	if ((err = azx_codec_create(chip, model)) < 0) {
		snd_card_free(card);
		return err;
	}
@@ -1595,7 +1584,6 @@ static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *
	}

	pci_set_drvdata(pci, card);
	dev++;

	return err;
}
+21 −37
Original line number Diff line number Diff line
@@ -64,34 +64,27 @@ MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
		"{AMD,AMD8111},"
	        "{ALI,M5455}}");

static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
static char *ac97_quirk[SNDRV_CARDS];
static int buggy_semaphore[SNDRV_CARDS];
static int buggy_irq[SNDRV_CARDS];
static int xbox[SNDRV_CARDS];

#ifdef SUPPORT_MIDI
static int mpu_port[SNDRV_CARDS]; /* disabled */
#endif

module_param_array(index, int, NULL, 0444);
static int index = SNDRV_DEFAULT_IDX1;	/* Index 0-MAX */
static char *id = SNDRV_DEFAULT_STR1;	/* ID for this card */
static int ac97_clock = 0;
static char *ac97_quirk;
static int buggy_semaphore;
static int buggy_irq;
static int xbox;

module_param(index, int, 0444);
MODULE_PARM_DESC(index, "Index value for Intel i8x0 soundcard.");
module_param_array(id, charp, NULL, 0444);
module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable Intel i8x0 soundcard.");
module_param_array(ac97_clock, int, NULL, 0444);
module_param(ac97_clock, int, 0444);
MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
module_param_array(ac97_quirk, charp, NULL, 0444);
module_param(ac97_quirk, charp, 0444);
MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
module_param_array(buggy_semaphore, bool, NULL, 0444);
module_param(buggy_semaphore, bool, 0444);
MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores.");
module_param_array(buggy_irq, bool, NULL, 0444);
module_param(buggy_irq, bool, 0444);
MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards.");
module_param_array(xbox, bool, NULL, 0444);
module_param(xbox, bool, 0444);
MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection.");

/*
@@ -2781,20 +2774,12 @@ static struct shortname_table {
static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
					const struct pci_device_id *pci_id)
{
	static int dev;
	snd_card_t *card;
	intel8x0_t *chip;
	int err;
	struct shortname_table *name;

	if (dev >= SNDRV_CARDS)
		return -ENODEV;
	if (!enable[dev]) {
		dev++;
		return -ENOENT;
	}

	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
	card = snd_card_new(index, id, THIS_MODULE, 0);
	if (card == NULL)
		return -ENOMEM;

@@ -2819,16 +2804,16 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
	}

	if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data,
				       buggy_semaphore[dev], &chip)) < 0) {
				       buggy_semaphore, &chip)) < 0) {
		snd_card_free(card);
		return err;
	}
	if (buggy_irq[dev])
	if (buggy_irq)
		chip->buggy_irq = 1;
	if (xbox[dev])
	if (xbox)
		chip->xbox = 1;

	if ((err = snd_intel8x0_mixer(chip, ac97_clock[dev], ac97_quirk[dev])) < 0) {
	if ((err = snd_intel8x0_mixer(chip, ac97_clock, ac97_quirk)) < 0) {
		snd_card_free(card);
		return err;
	}
@@ -2843,7 +2828,7 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
		 "%s with %s at %#lx, irq %i", card->shortname,
		 snd_ac97_get_short_name(chip->ac97[0]), chip->addr, chip->irq);

	if (! ac97_clock[dev])
	if (! ac97_clock)
		intel8x0_measure_ac97_clock(chip);

	if ((err = snd_card_register(card)) < 0) {
@@ -2851,7 +2836,6 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
		return err;
	}
	pci_set_drvdata(pci, card);
	dev++;
	return 0;
}

Loading