aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/ymfpci.h3
-rw-r--r--sound/pci/ymfpci/ymfpci.c5
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c8
3 files changed, 6 insertions, 10 deletions
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index d41cda97e952..a3c5de59a248 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -345,7 +345,6 @@ struct snd_ymfpci {
345 struct snd_kcontrol *spdif_pcm_ctl; 345 struct snd_kcontrol *spdif_pcm_ctl;
346 int mode_dup4ch; 346 int mode_dup4ch;
347 int rear_opened; 347 int rear_opened;
348 int rear_swap;
349 int spdif_opened; 348 int spdif_opened;
350 struct { 349 struct {
351 u16 left; 350 u16 left;
@@ -378,7 +377,7 @@ int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
378int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); 377int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
379int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); 378int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
380int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); 379int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
381int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch, int rear_swap); 380int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch);
382int snd_ymfpci_timer(struct snd_ymfpci *chip, int device); 381int snd_ymfpci_timer(struct snd_ymfpci *chip, int device);
383 382
384#endif /* __SOUND_YMFPCI_H */ 383#endif /* __SOUND_YMFPCI_H */
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 186453f7abe7..fd9b7b83a884 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -49,7 +49,6 @@ static long mpu_port[SNDRV_CARDS];
49static long joystick_port[SNDRV_CARDS]; 49static long joystick_port[SNDRV_CARDS];
50#endif 50#endif
51static int rear_switch[SNDRV_CARDS]; 51static int rear_switch[SNDRV_CARDS];
52static int rear_swap[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 };
53 52
54module_param_array(index, int, NULL, 0444); 53module_param_array(index, int, NULL, 0444);
55MODULE_PARM_DESC(index, "Index value for the Yamaha DS-1 PCI soundcard."); 54MODULE_PARM_DESC(index, "Index value for the Yamaha DS-1 PCI soundcard.");
@@ -67,8 +66,6 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address");
67#endif 66#endif
68module_param_array(rear_switch, bool, NULL, 0444); 67module_param_array(rear_switch, bool, NULL, 0444);
69MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch"); 68MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
70module_param_array(rear_swap, bool, NULL, 0444);
71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output");
72 69
73static struct pci_device_id snd_ymfpci_ids[] = { 70static struct pci_device_id snd_ymfpci_ids[] = {
74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */ 71 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */
@@ -298,7 +295,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
298 snd_card_free(card); 295 snd_card_free(card);
299 return err; 296 return err;
300 } 297 }
301 if ((err = snd_ymfpci_mixer(chip, rear_switch[dev], rear_swap[dev])) < 0) { 298 if ((err = snd_ymfpci_mixer(chip, rear_switch[dev])) < 0) {
302 snd_card_free(card); 299 snd_card_free(card);
303 return err; 300 return err;
304 } 301 }
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 79c58f3a6b7c..16be1f395484 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -910,7 +910,7 @@ static int snd_ymfpci_playback_open(struct snd_pcm_substream *substream)
910 ypcm = runtime->private_data; 910 ypcm = runtime->private_data;
911 ypcm->output_front = 1; 911 ypcm->output_front = 1;
912 ypcm->output_rear = chip->mode_dup4ch ? 1 : 0; 912 ypcm->output_rear = chip->mode_dup4ch ? 1 : 0;
913 ypcm->swap_rear = chip->rear_swap; 913 ypcm->swap_rear = 0;
914 spin_lock_irq(&chip->reg_lock); 914 spin_lock_irq(&chip->reg_lock);
915 if (ypcm->output_rear) { 915 if (ypcm->output_rear) {
916 ymfpci_open_extension(chip); 916 ymfpci_open_extension(chip);
@@ -936,6 +936,7 @@ static int snd_ymfpci_playback_spdif_open(struct snd_pcm_substream *substream)
936 ypcm = runtime->private_data; 936 ypcm = runtime->private_data;
937 ypcm->output_front = 0; 937 ypcm->output_front = 0;
938 ypcm->output_rear = 1; 938 ypcm->output_rear = 1;
939 ypcm->swap_rear = 1;
939 spin_lock_irq(&chip->reg_lock); 940 spin_lock_irq(&chip->reg_lock);
940 snd_ymfpci_writew(chip, YDSXGR_SPDIFOUTCTRL, 941 snd_ymfpci_writew(chip, YDSXGR_SPDIFOUTCTRL,
941 snd_ymfpci_readw(chip, YDSXGR_SPDIFOUTCTRL) | 2); 942 snd_ymfpci_readw(chip, YDSXGR_SPDIFOUTCTRL) | 2);
@@ -963,6 +964,7 @@ static int snd_ymfpci_playback_4ch_open(struct snd_pcm_substream *substream)
963 ypcm = runtime->private_data; 964 ypcm = runtime->private_data;
964 ypcm->output_front = 0; 965 ypcm->output_front = 0;
965 ypcm->output_rear = 1; 966 ypcm->output_rear = 1;
967 ypcm->swap_rear = 0;
966 spin_lock_irq(&chip->reg_lock); 968 spin_lock_irq(&chip->reg_lock);
967 ymfpci_open_extension(chip); 969 ymfpci_open_extension(chip);
968 chip->rear_opened++; 970 chip->rear_opened++;
@@ -1755,7 +1757,7 @@ static void snd_ymfpci_mixer_free_ac97(struct snd_ac97 *ac97)
1755 chip->ac97 = NULL; 1757 chip->ac97 = NULL;
1756} 1758}
1757 1759
1758int __devinit snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch, int rear_swap) 1760int __devinit snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch)
1759{ 1761{
1760 struct snd_ac97_template ac97; 1762 struct snd_ac97_template ac97;
1761 struct snd_kcontrol *kctl; 1763 struct snd_kcontrol *kctl;
@@ -1767,7 +1769,6 @@ int __devinit snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch, int rea
1767 .read = snd_ymfpci_codec_read, 1769 .read = snd_ymfpci_codec_read,
1768 }; 1770 };
1769 1771
1770 chip->rear_swap = rear_swap;
1771 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) 1772 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0)
1772 return err; 1773 return err;
1773 chip->ac97_bus->private_free = snd_ymfpci_mixer_free_ac97_bus; 1774 chip->ac97_bus->private_free = snd_ymfpci_mixer_free_ac97_bus;
@@ -2322,7 +2323,6 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
2322 return -EIO; 2323 return -EIO;
2323 } 2324 }
2324 2325
2325 chip->rear_swap = 1;
2326 if ((err = snd_ymfpci_ac3_init(chip)) < 0) { 2326 if ((err = snd_ymfpci_ac3_init(chip)) < 0) {
2327 snd_ymfpci_free(chip); 2327 snd_ymfpci_free(chip);
2328 return err; 2328 return err;