summaryrefslogtreecommitdiff
path: root/sound/pci/oxygen/xonar_lib.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-12-02 13:38:06 +0300
committerTakashi Iwai <tiwai@suse.de>2010-12-06 16:47:58 +0300
commit2509ec623d44320419d44d4060dbedf91b8d192d (patch)
tree1b54007d4896830334af9288104f8e89c6c1705d /sound/pci/oxygen/xonar_lib.c
parentf7e4bad74e1b18aaff6e89cf2bc4a3868a6ba56e (diff)
downloadlinux-2509ec623d44320419d44d4060dbedf91b8d192d.tar.xz
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.c6
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,
{
struct oxygen *chip = ctl->private_data;
u16 bit = ctl->private_value;
+ bool invert = ctl->private_value & XONAR_GPIO_BIT_INVERT;
value->value.integer.value[0] =
- !!(oxygen_read16(chip, OXYGEN_GPIO_DATA) & bit);
+ !!(oxygen_read16(chip, OXYGEN_GPIO_DATA) & bit) ^ invert;
return 0;
}
@@ -115,12 +116,13 @@ int xonar_gpio_bit_switch_put(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
u16 bit = ctl->private_value;
+ bool invert = ctl->private_value & XONAR_GPIO_BIT_INVERT;
u16 old_bits, new_bits;
int changed;
spin_lock_irq(&chip->reg_lock);
old_bits = oxygen_read16(chip, OXYGEN_GPIO_DATA);
- if (value->value.integer.value[0])
+ if (!!value->value.integer.value[0] ^ invert)
new_bits = old_bits | bit;
else
new_bits = old_bits & ~bit;