aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/oxygen/oxygen.c6
-rw-r--r--sound/pci/oxygen/oxygen_lib.c2
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c20
-rw-r--r--sound/pci/oxygen/virtuoso.c6
4 files changed, 18 insertions, 16 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index ba7a2a83f339..ecc0e6f9d277 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -19,10 +19,10 @@
19 19
20/* 20/*
21 * SPI 0 -> 1st AK4396 (front) 21 * SPI 0 -> 1st AK4396 (front)
22 * SPI 1 -> 2nd AK4396 (side) 22 * SPI 1 -> 2nd AK4396 (surround)
23 * SPI 2 -> 3rd AK4396 (center/LFE) 23 * SPI 2 -> 3rd AK4396 (center/LFE)
24 * SPI 3 -> WM8785 24 * SPI 3 -> WM8785
25 * SPI 4 -> 4th AK4396 (rear) 25 * SPI 4 -> 4th AK4396 (back)
26 * 26 *
27 * GPIO 0 -> DFS0 of AK5385 27 * GPIO 0 -> DFS0 of AK5385
28 * GPIO 1 -> DFS1 of AK5385 28 * GPIO 1 -> DFS1 of AK5385
@@ -99,7 +99,7 @@ static void ak4396_write(struct oxygen *chip, unsigned int codec,
99{ 99{
100 /* maps ALSA channel pair number to SPI output */ 100 /* maps ALSA channel pair number to SPI output */
101 static const u8 codec_spi_map[4] = { 101 static const u8 codec_spi_map[4] = {
102 0, 4, 2, 1 102 0, 1, 2, 4
103 }; 103 };
104 oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER_WRITE | 104 oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER_WRITE |
105 OXYGEN_SPI_DATA_LENGTH_2 | 105 OXYGEN_SPI_DATA_LENGTH_2 |
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index 2418ceb44858..9cd4be2593ab 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -193,7 +193,7 @@ static void __devinit oxygen_init(struct oxygen *chip)
193 oxygen_write16(chip, OXYGEN_I2S_C_FORMAT, 0x010a); 193 oxygen_write16(chip, OXYGEN_I2S_C_FORMAT, 0x010a);
194 oxygen_set_bits32(chip, OXYGEN_SPDIF_CONTROL, OXYGEN_SPDIF_MAGIC2); 194 oxygen_set_bits32(chip, OXYGEN_SPDIF_CONTROL, OXYGEN_SPDIF_MAGIC2);
195 oxygen_write32(chip, OXYGEN_SPDIF_OUTPUT_BITS, chip->spdif_bits); 195 oxygen_write32(chip, OXYGEN_SPDIF_OUTPUT_BITS, chip->spdif_bits);
196 oxygen_write16(chip, OXYGEN_PLAY_ROUTING, 0x6c00); 196 oxygen_write16(chip, OXYGEN_PLAY_ROUTING, 0xe100);
197 oxygen_write8(chip, OXYGEN_REC_ROUTING, 0x10); 197 oxygen_write8(chip, OXYGEN_REC_ROUTING, 0x10);
198 oxygen_write8(chip, OXYGEN_ADC_MONITOR, 0x00); 198 oxygen_write8(chip, OXYGEN_ADC_MONITOR, 0x00);
199 oxygen_write8(chip, OXYGEN_A_MONITOR_ROUTING, 0xe4); 199 oxygen_write8(chip, OXYGEN_A_MONITOR_ROUTING, 0xe4);
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index 7208b0fb3ee5..ca72799bea27 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -99,7 +99,7 @@ static int dac_mute_put(struct snd_kcontrol *ctl,
99static int upmix_info(struct snd_kcontrol *ctl, struct snd_ctl_elem_info *info) 99static int upmix_info(struct snd_kcontrol *ctl, struct snd_ctl_elem_info *info)
100{ 100{
101 static const char *const names[3] = { 101 static const char *const names[3] = {
102 "Front", "Front+Rear", "Front+Rear+Side" 102 "Front", "Front+Surround", "Front+Surround+Back"
103 }; 103 };
104 info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 104 info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
105 info->count = 1; 105 info->count = 1;
@@ -122,20 +122,22 @@ static int upmix_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
122 122
123void oxygen_update_dac_routing(struct oxygen *chip) 123void oxygen_update_dac_routing(struct oxygen *chip)
124{ 124{
125 /*
126 * hardware channel order: front, side, center/lfe, rear
127 * ALSA channel order: front, rear, center/lfe, side
128 */
129 static const unsigned int reg_values[3] = { 125 static const unsigned int reg_values[3] = {
130 0x6c00, 0x2c00, 0x2000 126 0xe100, /* front <- 0, surround <- 1, center <- 2, back <- 3 */
127 0xe000, /* front <- 0, surround <- 0, center <- 2, back <- 3 */
128 0x2000 /* front <- 0, surround <- 0, center <- 2, back <- 0 */
131 }; 129 };
130 u8 channels;
132 unsigned int reg_value; 131 unsigned int reg_value;
133 132
134 if ((oxygen_read8(chip, OXYGEN_PLAY_CHANNELS) & 133 channels = oxygen_read8(chip, OXYGEN_PLAY_CHANNELS) &
135 OXYGEN_PLAY_CHANNELS_MASK) == OXYGEN_PLAY_CHANNELS_2) 134 OXYGEN_PLAY_CHANNELS_MASK;
135 if (channels == OXYGEN_PLAY_CHANNELS_2)
136 reg_value = reg_values[chip->dac_routing]; 136 reg_value = reg_values[chip->dac_routing];
137 else if (channels == OXYGEN_PLAY_CHANNELS_8)
138 reg_value = 0x6c00; /* surround <- 3, back <- 1 */
137 else 139 else
138 reg_value = 0x6c00; 140 reg_value = 0xe100;
139 oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, 0xff00); 141 oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, 0xff00);
140} 142}
141 143
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index 6603a685ccca..bfd1f3c3dfcd 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -19,9 +19,9 @@
19 19
20/* 20/*
21 * SPI 0 -> 1st PCM1796 (front) 21 * SPI 0 -> 1st PCM1796 (front)
22 * SPI 1 -> 2nd PCM1796 (side) 22 * SPI 1 -> 2nd PCM1796 (surround)
23 * SPI 2 -> 3rd PCM1796 (center/LFE) 23 * SPI 2 -> 3rd PCM1796 (center/LFE)
24 * SPI 4 -> 4th PCM1796 (rear) 24 * SPI 4 -> 4th PCM1796 (back)
25 * 25 *
26 * GPIO 2 -> M0 of CS5381 26 * GPIO 2 -> M0 of CS5381
27 * GPIO 3 -> M1 of CS5381 27 * GPIO 3 -> M1 of CS5381
@@ -76,7 +76,7 @@ static void pcm1796_write(struct oxygen *chip, unsigned int codec,
76{ 76{
77 /* maps ALSA channel pair number to SPI output */ 77 /* maps ALSA channel pair number to SPI output */
78 static const u8 codec_map[4] = { 78 static const u8 codec_map[4] = {
79 0, 4, 2, 1 79 0, 1, 2, 4
80 }; 80 };
81 oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER_WRITE | 81 oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER_WRITE |
82 OXYGEN_SPI_DATA_LENGTH_2 | 82 OXYGEN_SPI_DATA_LENGTH_2 |