aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_mixer.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-01-14 02:55:03 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:56 -0500
commit7113e95812f508bff10f95f2e52ce6ee8cda1875 (patch)
tree88ffdb570507c19a51ce5d48db474f1ec3788469 /sound/pci/oxygen/oxygen_mixer.c
parentbc9abce0de0b180817bc7e9f73145ef0b6a464ef (diff)
[ALSA] oxygen: fix channel routing
Do not exchange the surround and back jacks except when in 7.1 mode where the surround jack is not rear but side. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/oxygen/oxygen_mixer.c')
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c20
1 files changed, 11 insertions, 9 deletions
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