Commit e4f55d80 authored by James Courtier-Dutton's avatar James Courtier-Dutton Committed by Jaroslav Kysela

[ALSA] snd-ca0106: Add new card variant.

Fixed ALSA bug#2326
Signed-off-by: default avatarJames Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 4d361285
...@@ -154,6 +154,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative,SB CA0106 chip}}"); ...@@ -154,6 +154,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative,SB CA0106 chip}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */
module_param_array(index, int, NULL, 0444); module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for the CA0106 soundcard."); MODULE_PARM_DESC(index, "Index value for the CA0106 soundcard.");
...@@ -161,6 +162,8 @@ module_param_array(id, charp, NULL, 0444); ...@@ -161,6 +162,8 @@ module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for the CA0106 soundcard."); MODULE_PARM_DESC(id, "ID string for the CA0106 soundcard.");
module_param_array(enable, bool, NULL, 0444); module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable the CA0106 soundcard."); MODULE_PARM_DESC(enable, "Enable the CA0106 soundcard.");
module_param_array(subsystem, uint, NULL, 0444);
MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
#include "ca0106.h" #include "ca0106.h"
...@@ -194,6 +197,17 @@ static struct snd_ca0106_details ca0106_chip_details[] = { ...@@ -194,6 +197,17 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
.gpio_type = 1, .gpio_type = 1,
.i2c_adc = 1, .i2c_adc = 1,
.spi_dac = 1 } , .spi_dac = 1 } ,
/* New Audigy LS. Has a different DAC. */
/* SB0570:
* CTRL:CA0106-DAT
* ADC: WM8775EDS
* DAC: WM8768GEDS
*/
{ .serial = 0x10111102,
.name = "Audigy LS [SB0570a]",
.gpio_type = 1,
.i2c_adc = 1,
.spi_dac = 1 } ,
/* MSI K8N Diamond Motherboard with onboard SB Live 24bit without AC97 */ /* MSI K8N Diamond Motherboard with onboard SB Live 24bit without AC97 */
/* SB0438 /* SB0438
* CTRL:CA0106-DAT * CTRL:CA0106-DAT
...@@ -1223,7 +1237,7 @@ static unsigned int i2c_adc_init[][2] = { ...@@ -1223,7 +1237,7 @@ static unsigned int i2c_adc_init[][2] = {
{ 0x15, ADC_MUX_LINEIN }, /* ADC Mixer control */ { 0x15, ADC_MUX_LINEIN }, /* ADC Mixer control */
}; };
static int __devinit snd_ca0106_create(struct snd_card *card, static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
struct pci_dev *pci, struct pci_dev *pci,
struct snd_ca0106 **rchip) struct snd_ca0106 **rchip)
{ {
...@@ -1286,17 +1300,25 @@ static int __devinit snd_ca0106_create(struct snd_card *card, ...@@ -1286,17 +1300,25 @@ static int __devinit snd_ca0106_create(struct snd_card *card,
pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
#if 1 #if 1
printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model, printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model,
chip->revision, chip->serial); chip->revision, chip->serial);
#endif #endif
strcpy(card->driver, "CA0106"); strcpy(card->driver, "CA0106");
strcpy(card->shortname, "CA0106"); strcpy(card->shortname, "CA0106");
for (c = ca0106_chip_details; c->serial; c++) { for (c = ca0106_chip_details; c->serial; c++) {
if (c->serial == chip->serial) if (subsystem[dev]) {
if (c->serial == subsystem[dev])
break;
} else if (c->serial == chip->serial)
break; break;
} }
chip->details = c; chip->details = c;
if (subsystem[dev]) {
printk(KERN_INFO "snd-ca0106: Sound card name=%s, subsystem=0x%x. Forced to subsytem=0x%x\n",
c->name, chip->serial, subsystem[dev]);
}
sprintf(card->longname, "%s at 0x%lx irq %i", sprintf(card->longname, "%s at 0x%lx irq %i",
c->name, chip->port, chip->irq); c->name, chip->port, chip->irq);
...@@ -1539,7 +1561,7 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci, ...@@ -1539,7 +1561,7 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
if (card == NULL) if (card == NULL)
return -ENOMEM; return -ENOMEM;
if ((err = snd_ca0106_create(card, pci, &chip)) < 0) { if ((err = snd_ca0106_create(dev, card, pci, &chip)) < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment