[PATCH] [UBUNTU:{include/sound, sound/pci/ymfpci}/] Fix swap_rear for S/PDIF passthrough

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Tue Oct 10 08:26:56 UTC 2006


From 924eaf615b3d3d35fda422b7d291d765cdbe4cf9 Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun at garnish.localdomain>
Date: Tue, 10 Oct 2006 04:28:27 -0400
Subject: [PATCH] [UBUNTU:{include/sound,sound/pci/ymfpci}/] Fix swap_rear for S/PDIF passthrough

UpstreamStatus: Added in upstream alsa-kernel hg changeset:
		b469a0900007 [http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=b469a0900007b640926a338546683d86eccb273b;style=raw]

This patch fixes an incorrect assignment of swap_rear, which was
broken since the patch "ymfpci - make rear channel swap optional",
and also removes the module parameter "rear_swap".

This commit is applicable to both Dapper and Edgy linux-source but is
targeted toward Dapper's (typedef adjustment necessary for Edgy's).

Signed-off-by: Glen Masgai <mimosius at gmx.de>
Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>
---
 include/sound/ymfpci.h         |    3 +--
 sound/pci/ymfpci/ymfpci.c      |    5 +----
 sound/pci/ymfpci/ymfpci_main.c |    8 ++++----
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index ee0a436..34ebbd3 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -346,7 +346,6 @@ #endif
 	snd_kcontrol_t *spdif_pcm_ctl;
 	int mode_dup4ch;
 	int rear_opened;
-	int rear_swap;
 	int spdif_opened;
 	struct {
 		u16 left;
@@ -378,7 +377,7 @@ int snd_ymfpci_pcm(ymfpci_t *chip, int d
 int snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
 int snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
 int snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
-int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch, int rear_swap);
+int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch);
 int snd_ymfpci_timer(ymfpci_t *chip, int device);
 
 #endif /* __SOUND_YMFPCI_H */
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 0072036..b2e18cc 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -49,7 +49,6 @@ #ifdef SUPPORT_JOYSTICK
 static long joystick_port[SNDRV_CARDS];
 #endif
 static int rear_switch[SNDRV_CARDS];
-static int rear_swap[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 };
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for the Yamaha DS-XG PCI soundcard.");
@@ -67,8 +66,6 @@ MODULE_PARM_DESC(joystick_port, "Joystic
 #endif
 module_param_array(rear_switch, bool, NULL, 0444);
 MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
-module_param_array(rear_swap, bool, NULL, 0444);
-MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output");
 
 static struct pci_device_id snd_ymfpci_ids[] = {
         { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* YMF724 */
@@ -297,7 +294,7 @@ static int __devinit snd_card_ymfpci_pro
 		snd_card_free(card);
 		return err;
 	}
-	if ((err = snd_ymfpci_mixer(chip, rear_switch[dev], rear_swap[dev])) < 0) {
+	if ((err = snd_ymfpci_mixer(chip, rear_switch[dev])) < 0) {
 		snd_card_free(card);
 		return err;
 	}
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 2d92770..e7c5a2e 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -901,7 +901,7 @@ static int snd_ymfpci_playback_open(snd_
 	ypcm = runtime->private_data;
 	ypcm->output_front = 1;
 	ypcm->output_rear = chip->mode_dup4ch ? 1 : 0;
-	ypcm->swap_rear = chip->rear_swap;
+	ypcm->swap_rear = 0;
 	spin_lock_irq(&chip->reg_lock);
 	if (ypcm->output_rear) {
 		ymfpci_open_extension(chip);
@@ -927,6 +927,7 @@ static int snd_ymfpci_playback_spdif_ope
 	ypcm = runtime->private_data;
 	ypcm->output_front = 0;
 	ypcm->output_rear = 1;
+	ypcm->swap_rear = 1;
 	spin_lock_irq(&chip->reg_lock);
 	snd_ymfpci_writew(chip, YDSXGR_SPDIFOUTCTRL,
 			  snd_ymfpci_readw(chip, YDSXGR_SPDIFOUTCTRL) | 2);
@@ -954,6 +955,7 @@ static int snd_ymfpci_playback_4ch_open(
 	ypcm = runtime->private_data;
 	ypcm->output_front = 0;
 	ypcm->output_rear = 1;
+	ypcm->swap_rear = 0;
 	spin_lock_irq(&chip->reg_lock);
 	ymfpci_open_extension(chip);
 	chip->rear_opened++;
@@ -1772,7 +1774,7 @@ static void snd_ymfpci_mixer_free_ac97(a
 	chip->ac97 = NULL;
 }
 
-int __devinit snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch, int rear_swap)
+int __devinit snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch)
 {
 	ac97_template_t ac97;
 	snd_kcontrol_t *kctl;
@@ -1784,7 +1786,6 @@ int __devinit snd_ymfpci_mixer(ymfpci_t 
 		.read = snd_ymfpci_codec_read,
 	};
 
-	chip->rear_swap = rear_swap;
 	if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0)
 		return err;
 	chip->ac97_bus->private_free = snd_ymfpci_mixer_free_ac97_bus;
@@ -2332,7 +2333,6 @@ int __devinit snd_ymfpci_create(snd_card
 		return -EIO;
 	}
 
-	chip->rear_swap = 1;
 	if ((err = snd_ymfpci_ac3_init(chip)) < 0) {
 		snd_ymfpci_free(chip);
 		return err;
-- 
1.4.1


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:  0xC88ABDA3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20061010/d9e8e721/attachment.pgp>


More information about the kernel-team mailing list