From a67ff6a54095e27093ea501fb143fefe51a536c2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 15 Dec 2011 13:49:36 +1030 Subject: ALSA: module_param: make bool parameters really bool module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Signed-off-by: Rusty Russell Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ice1712.c | 4 ++-- sound/pci/ice1712/ice1724.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/pci/ice1712') diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 44446f2222d9..132a86e09d07 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -84,9 +84,9 @@ MODULE_SUPPORTED_DEVICE("{" 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 bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ static char *model[SNDRV_CARDS]; -static int omni[SNDRV_CARDS]; /* Delta44 & 66 Omni I/O support */ +static bool omni[SNDRV_CARDS]; /* Delta44 & 66 Omni I/O support */ static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transceiver reset timeout value in msec */ static int dxr_enable[SNDRV_CARDS]; /* DXR enable for DMX6FIRE */ diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 4353e76bf0a6..4dc51246d1ae 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -80,7 +80,7 @@ MODULE_SUPPORTED_DEVICE("{" 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 bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static char *model[SNDRV_CARDS]; module_param_array(index, int, NULL, 0444); -- cgit v1.2.1 From e7848163aa2a649d9065f230fadff80dc3519775 Mon Sep 17 00:00:00 2001 From: Pavel Hofman Date: Thu, 5 Jan 2012 23:05:18 +0100 Subject: ALSA: ice1724 - Check for ac97 to avoid kernel oops Cards with identical PCI ids but no AC97 config in EEPROM do not have the ac97 field initialized. We must check for this case to avoid kernel oops. Signed-off-by: Pavel Hofman Cc: Signed-off-by: Takashi Iwai --- sound/pci/ice1712/amp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sound/pci/ice1712') diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c index e328cfb7620c..e525da2673be 100644 --- a/sound/pci/ice1712/amp.c +++ b/sound/pci/ice1712/amp.c @@ -68,8 +68,11 @@ static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice) static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice) { - /* we use pins 39 and 41 of the VT1616 for left and right read outputs */ - snd_ac97_write_cache(ice->ac97, 0x5a, snd_ac97_read(ice->ac97, 0x5a) & ~0x8000); + if (ice->ac97) + /* we use pins 39 and 41 of the VT1616 for left and right + read outputs */ + snd_ac97_write_cache(ice->ac97, 0x5a, + snd_ac97_read(ice->ac97, 0x5a) & ~0x8000); return 0; } -- cgit v1.2.1 From 219e2cd41b5014c5a6ed4d1748f65f55f74a862f Mon Sep 17 00:00:00 2001 From: Pavel Hofman Date: Thu, 5 Jan 2012 22:01:56 +0100 Subject: ALSA: ice1724 - External clock item only for cards with SPDIF_IN Append the external clock item to the clock list only if the SPDIF_IN capability is defined in the SPDIF register. Signed-off-by: Pavel Hofman Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ice1724.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sound/pci/ice1712') diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 4dc51246d1ae..9e18d3a3f038 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -1825,7 +1825,12 @@ static int snd_vt1724_pro_internal_clock_info(struct snd_kcontrol *kcontrol, uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; - uinfo->value.enumerated.items = hw_rates_count + ice->ext_clock_count; + /* internal clocks */ + uinfo->value.enumerated.items = hw_rates_count; + /* external clocks */ + if (ice->force_rdma1 || + (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_IN)) + uinfo->value.enumerated.items += ice->ext_clock_count; /* upper limit - keep at top */ if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; -- cgit v1.2.1 From ffd364ddd3090e2ef0d4882970c1e342db8b482f Mon Sep 17 00:00:00 2001 From: Pavel Hofman Date: Tue, 10 Jan 2012 20:45:28 +0100 Subject: ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations Add the capture pcm only if there is at least one ADC configured in the SYSCONF register. Signed-off-by: Pavel Hofman Signed-off-by: Takashi Iwai --- sound/pci/ice1712/envy24ht.h | 1 + sound/pci/ice1712/ice1724.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sound/pci/ice1712') diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h index a0c5e009bb4a..4ca33a800bc8 100644 --- a/sound/pci/ice1712/envy24ht.h +++ b/sound/pci/ice1712/envy24ht.h @@ -66,6 +66,7 @@ enum { #define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */ #define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */ #define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */ +#define VT1724_CFG_ADC_NONE 0x0c /* no ADCs */ #define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */ #define VT1724_REG_AC97_CFG 0x05 /* byte */ diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 9e18d3a3f038..e797823ddc3a 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -1117,14 +1117,21 @@ static struct snd_pcm_ops snd_vt1724_capture_pro_ops = { static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device) { struct snd_pcm *pcm; - int err; + int capt, err; - err = snd_pcm_new(ice->card, "ICE1724", device, 1, 1, &pcm); + if ((ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_ADC_MASK) == + VT1724_CFG_ADC_NONE) + capt = 0; + else + capt = 1; + err = snd_pcm_new(ice->card, "ICE1724", device, 1, capt, &pcm); if (err < 0) return err; snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_vt1724_capture_pro_ops); + if (capt) + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, + &snd_vt1724_capture_pro_ops); pcm->private_data = ice; pcm->info_flags = 0; -- cgit v1.2.1 From 2b151ef734b1be749e355f32f94f649acfde0f48 Mon Sep 17 00:00:00 2001 From: Pavel Hofman Date: Tue, 10 Jan 2012 20:28:47 +0100 Subject: ALSA: ice1724 - Allow card info based on model only When two different cards share the same PCI vendor/subvendor identification, allow card info based on model only. Do not require subvendor ID. Signed-off-by: Pavel Hofman Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ice1724.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sound/pci/ice1712') diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index e797823ddc3a..352f3fffa645 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -2282,7 +2282,7 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice, } } for (tbl = card_tables; *tbl; tbl++) { - for (c = *tbl; c->subvendor; c++) { + for (c = *tbl; c->name; c++) { if (modelname && c->model && !strcmp(modelname, c->model)) { printk(KERN_INFO "ice1724: Using board model %s\n", @@ -2591,8 +2591,10 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci, ice->ext_clock_count = 0; for (tbl = card_tables; *tbl; tbl++) { - for (c = *tbl; c->subvendor; c++) { - if (c->subvendor == ice->eeprom.subvendor) { + for (c = *tbl; c->name; c++) { + if ((model[dev] && c->model && + !strcmp(model[dev], c->model)) || + (c->subvendor == ice->eeprom.subvendor)) { strcpy(card->shortname, c->name); if (c->driver) /* specific driver? */ strcpy(card->driver, c->driver); -- cgit v1.2.1 From 52cd0a76fd7e7b47f0b0ad594ad5fd3b69949f76 Mon Sep 17 00:00:00 2001 From: Pavel Hofman Date: Tue, 10 Jan 2012 20:28:48 +0100 Subject: ALSA: ice1724 - Support for ooAoo SQ210a This card shares PCI ids with Chaintec AV710. Therefore, it will not be detected automatically, it can only be activated by the module parameter model=sq210a. Signed-off-by: Pavel Hofman Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ice1724.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'sound/pci/ice1712') diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 352f3fffa645..92362973764d 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -2185,6 +2185,40 @@ static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { static struct snd_ice1712_card_info no_matched __devinitdata; + +/* + ooAoo cards with no controls +*/ +static unsigned char ooaoo_sq210_eeprom[] __devinitdata = { + [ICE_EEP2_SYSCONF] = 0x4c, /* 49MHz crystal, no mpu401, no ADC, + 1xDACs */ + [ICE_EEP2_ACLINK] = 0x80, /* I2S */ + [ICE_EEP2_I2S] = 0x78, /* no volume, 96k, 24bit, 192k */ + [ICE_EEP2_SPDIF] = 0xc1, /* out-en, out-int, out-ext */ + [ICE_EEP2_GPIO_DIR] = 0x00, /* no GPIOs are used */ + [ICE_EEP2_GPIO_DIR1] = 0x00, + [ICE_EEP2_GPIO_DIR2] = 0x00, + [ICE_EEP2_GPIO_MASK] = 0xff, + [ICE_EEP2_GPIO_MASK1] = 0xff, + [ICE_EEP2_GPIO_MASK2] = 0xff, + + [ICE_EEP2_GPIO_STATE] = 0x00, /* inputs */ + [ICE_EEP2_GPIO_STATE1] = 0x00, /* all 1, but GPIO_CPLD_RW + and GPIO15 always zero */ + [ICE_EEP2_GPIO_STATE2] = 0x00, /* inputs */ +}; + + +struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] __devinitdata = { + { + .name = "ooAoo SQ210a", + .model = "sq210a", + .eeprom_size = sizeof(ooaoo_sq210_eeprom), + .eeprom_data = ooaoo_sq210_eeprom, + }, + { } /* terminator */ +}; + static struct snd_ice1712_card_info *card_tables[] __devinitdata = { snd_vt1724_revo_cards, snd_vt1724_amp_cards, @@ -2199,6 +2233,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = { snd_vt1724_wtm_cards, snd_vt1724_se_cards, snd_vt1724_qtet_cards, + snd_vt1724_ooaoo_cards, NULL, }; -- cgit v1.2.1