diff options
author | Jaroslav Kysela <perex@suse.cz> | 2005-11-28 04:50:59 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:29:53 -0500 |
commit | 015b6a198f51d660797b78c6c7ee60d0252ebf40 (patch) | |
tree | 827f8caeabbf69f4932d4fd1ee054876dfd9e738 | |
parent | 16f47bb66000a917a33a0da67ef2823b239c36f6 (diff) |
[ALSA] ens1371: added spdif and lineio module options
Modules: ENS1370/1+ driver
- spdif module option: some hardware revisions are without spdif output
- lineio module option: force shared line in / rear out jack settings
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/pci/ens1370.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index ff86fabc98c3..856f7c63d32f 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -86,6 +86,8 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ | |||
86 | #ifdef SUPPORT_JOYSTICK | 86 | #ifdef SUPPORT_JOYSTICK |
87 | #ifdef CHIP1371 | 87 | #ifdef CHIP1371 |
88 | static int joystick_port[SNDRV_CARDS]; | 88 | static int joystick_port[SNDRV_CARDS]; |
89 | static int spdif[SNDRV_CARDS]; | ||
90 | static int lineio[SNDRV_CARDS]; | ||
89 | #else | 91 | #else |
90 | static int joystick[SNDRV_CARDS]; | 92 | static int joystick[SNDRV_CARDS]; |
91 | #endif | 93 | #endif |
@@ -101,6 +103,10 @@ MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard."); | |||
101 | #ifdef CHIP1371 | 103 | #ifdef CHIP1371 |
102 | module_param_array(joystick_port, int, NULL, 0444); | 104 | module_param_array(joystick_port, int, NULL, 0444); |
103 | MODULE_PARM_DESC(joystick_port, "Joystick port address."); | 105 | MODULE_PARM_DESC(joystick_port, "Joystick port address."); |
106 | module_param_array(spdif, int, NULL, 0444); | ||
107 | MODULE_PARM_DESC(spdif, "S/PDIF output (-1 = none, 0 = auto, 1 = force)."); | ||
108 | module_param_array(lineio, int, NULL, 0444); | ||
109 | MODULE_PARM_DESC(lineio, "Line In to Rear Out (0 = auto, 1 = force)."); | ||
104 | #else | 110 | #else |
105 | module_param_array(joystick, bool, NULL, 0444); | 111 | module_param_array(joystick, bool, NULL, 0444); |
106 | MODULE_PARM_DESC(joystick, "Enable joystick."); | 112 | MODULE_PARM_DESC(joystick, "Enable joystick."); |
@@ -1608,7 +1614,7 @@ static struct { | |||
1608 | { .vid = PCI_ANY_ID, .did = PCI_ANY_ID } | 1614 | { .vid = PCI_ANY_ID, .did = PCI_ANY_ID } |
1609 | }; | 1615 | }; |
1610 | 1616 | ||
1611 | static int snd_ensoniq_1371_mixer(struct ensoniq * ensoniq) | 1617 | static int snd_ensoniq_1371_mixer(struct ensoniq * ensoniq, int has_spdif, int has_line) |
1612 | { | 1618 | { |
1613 | struct snd_card *card = ensoniq->card; | 1619 | struct snd_card *card = ensoniq->card; |
1614 | struct snd_ac97_bus *pbus; | 1620 | struct snd_ac97_bus *pbus; |
@@ -1630,12 +1636,15 @@ static int snd_ensoniq_1371_mixer(struct ensoniq * ensoniq) | |||
1630 | if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) | 1636 | if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) |
1631 | return err; | 1637 | return err; |
1632 | for (idx = 0; es1371_spdif_present[idx].vid != (unsigned short)PCI_ANY_ID; idx++) | 1638 | for (idx = 0; es1371_spdif_present[idx].vid != (unsigned short)PCI_ANY_ID; idx++) |
1633 | if (ensoniq->pci->vendor == es1371_spdif_present[idx].vid && | 1639 | if ((ensoniq->pci->vendor == es1371_spdif_present[idx].vid && |
1634 | ensoniq->pci->device == es1371_spdif_present[idx].did && | 1640 | ensoniq->pci->device == es1371_spdif_present[idx].did && |
1635 | ensoniq->rev == es1371_spdif_present[idx].rev) { | 1641 | ensoniq->rev == es1371_spdif_present[idx].rev) || has_spdif > 0) { |
1636 | struct snd_kcontrol *kctl; | 1642 | struct snd_kcontrol *kctl; |
1637 | int i, index = 0; | 1643 | int i, index = 0; |
1638 | 1644 | ||
1645 | if (has_spdif < 0) | ||
1646 | break; | ||
1647 | |||
1639 | ensoniq->spdif_default = ensoniq->spdif_stream = | 1648 | ensoniq->spdif_default = ensoniq->spdif_stream = |
1640 | SNDRV_PCM_DEFAULT_CON_SPDIF; | 1649 | SNDRV_PCM_DEFAULT_CON_SPDIF; |
1641 | outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS)); | 1650 | outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS)); |
@@ -1664,7 +1673,8 @@ static int snd_ensoniq_1371_mixer(struct ensoniq * ensoniq) | |||
1664 | if (((ensoniq->subsystem_vendor_id == 0x1274) && | 1673 | if (((ensoniq->subsystem_vendor_id == 0x1274) && |
1665 | (ensoniq->subsystem_device_id == 0x2000)) || /* GA-7DXR */ | 1674 | (ensoniq->subsystem_device_id == 0x2000)) || /* GA-7DXR */ |
1666 | ((ensoniq->subsystem_vendor_id == 0x1458) && | 1675 | ((ensoniq->subsystem_vendor_id == 0x1458) && |
1667 | (ensoniq->subsystem_device_id == 0xa000))) { /* GA-8IEXP */ | 1676 | (ensoniq->subsystem_device_id == 0xa000)) || /* GA-8IEXP */ |
1677 | has_line > 0) { | ||
1668 | err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line, ensoniq)); | 1678 | err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line, ensoniq)); |
1669 | if (err < 0) | 1679 | if (err < 0) |
1670 | return err; | 1680 | return err; |
@@ -2449,7 +2459,7 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci, | |||
2449 | } | 2459 | } |
2450 | #endif | 2460 | #endif |
2451 | #ifdef CHIP1371 | 2461 | #ifdef CHIP1371 |
2452 | if ((err = snd_ensoniq_1371_mixer(ensoniq)) < 0) { | 2462 | if ((err = snd_ensoniq_1371_mixer(ensoniq, spdif[dev], lineio[dev])) < 0) { |
2453 | snd_card_free(card); | 2463 | snd_card_free(card); |
2454 | return err; | 2464 | return err; |
2455 | } | 2465 | } |