diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-12-02 05:38:06 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-12-06 08:47:58 -0500 |
commit | 2509ec623d44320419d44d4060dbedf91b8d192d (patch) | |
tree | 1b54007d4896830334af9288104f8e89c6c1705d /sound/pci/oxygen/xonar_lib.c | |
parent | f7e4bad74e1b18aaff6e89cf2bc4a3868a6ba56e (diff) |
ALSA: virtuoso: add HDMI enable switch for HDAV1.3
The GPIO bit that enables analog output on the Xonar HDAV1.3 also
disables the HDMI audio output, so we better add a switch for it.
Hopefully, this is sufficient to make the HDMI output work.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen/xonar_lib.c')
-rw-r--r-- | sound/pci/oxygen/xonar_lib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/oxygen/xonar_lib.c b/sound/pci/oxygen/xonar_lib.c index b3ff71316653..0ebe7f5916f9 100644 --- a/sound/pci/oxygen/xonar_lib.c +++ b/sound/pci/oxygen/xonar_lib.c | |||
@@ -104,9 +104,10 @@ int xonar_gpio_bit_switch_get(struct snd_kcontrol *ctl, | |||
104 | { | 104 | { |
105 | struct oxygen *chip = ctl->private_data; | 105 | struct oxygen *chip = ctl->private_data; |
106 | u16 bit = ctl->private_value; | 106 | u16 bit = ctl->private_value; |
107 | bool invert = ctl->private_value & XONAR_GPIO_BIT_INVERT; | ||
107 | 108 | ||
108 | value->value.integer.value[0] = | 109 | value->value.integer.value[0] = |
109 | !!(oxygen_read16(chip, OXYGEN_GPIO_DATA) & bit); | 110 | !!(oxygen_read16(chip, OXYGEN_GPIO_DATA) & bit) ^ invert; |
110 | return 0; | 111 | return 0; |
111 | } | 112 | } |
112 | 113 | ||
@@ -115,12 +116,13 @@ int xonar_gpio_bit_switch_put(struct snd_kcontrol *ctl, | |||
115 | { | 116 | { |
116 | struct oxygen *chip = ctl->private_data; | 117 | struct oxygen *chip = ctl->private_data; |
117 | u16 bit = ctl->private_value; | 118 | u16 bit = ctl->private_value; |
119 | bool invert = ctl->private_value & XONAR_GPIO_BIT_INVERT; | ||
118 | u16 old_bits, new_bits; | 120 | u16 old_bits, new_bits; |
119 | int changed; | 121 | int changed; |
120 | 122 | ||
121 | spin_lock_irq(&chip->reg_lock); | 123 | spin_lock_irq(&chip->reg_lock); |
122 | old_bits = oxygen_read16(chip, OXYGEN_GPIO_DATA); | 124 | old_bits = oxygen_read16(chip, OXYGEN_GPIO_DATA); |
123 | if (value->value.integer.value[0]) | 125 | if (!!value->value.integer.value[0] ^ invert) |
124 | new_bits = old_bits | bit; | 126 | new_bits = old_bits | bit; |
125 | else | 127 | else |
126 | new_bits = old_bits & ~bit; | 128 | new_bits = old_bits & ~bit; |