aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/Kconfig2
-rw-r--r--sound/pci/oxygen/xonar.h2
-rw-r--r--sound/pci/oxygen/xonar_lib.c6
-rw-r--r--sound/pci/oxygen/xonar_pcm179x.c19
4 files changed, 25 insertions, 4 deletions
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 5add96bdf172..7b2678a25ca0 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -817,7 +817,7 @@ config SND_VIRTUOSO
817 Say Y here to include support for sound cards based on the 817 Say Y here to include support for sound cards based on the
818 Asus AV66/AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X, DS, 818 Asus AV66/AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X, DS,
819 Essence ST (Deluxe), and Essence STX. 819 Essence ST (Deluxe), and Essence STX.
820 Support for the HDAV1.3 (Deluxe) is incomplete; for the 820 Support for the HDAV1.3 (Deluxe) is experimental; for the
821 HDAV1.3 Slim and Xense, missing. 821 HDAV1.3 Slim and Xense, missing.
822 822
823 To compile this driver as a module, choose M here: the module 823 To compile this driver as a module, choose M here: the module
diff --git a/sound/pci/oxygen/xonar.h b/sound/pci/oxygen/xonar.h
index b35343b0a9a5..0434c207e811 100644
--- a/sound/pci/oxygen/xonar.h
+++ b/sound/pci/oxygen/xonar.h
@@ -24,6 +24,8 @@ void xonar_init_ext_power(struct oxygen *chip);
24void xonar_init_cs53x1(struct oxygen *chip); 24void xonar_init_cs53x1(struct oxygen *chip);
25void xonar_set_cs53x1_params(struct oxygen *chip, 25void xonar_set_cs53x1_params(struct oxygen *chip,
26 struct snd_pcm_hw_params *params); 26 struct snd_pcm_hw_params *params);
27
28#define XONAR_GPIO_BIT_INVERT (1 << 16)
27int xonar_gpio_bit_switch_get(struct snd_kcontrol *ctl, 29int xonar_gpio_bit_switch_get(struct snd_kcontrol *ctl,
28 struct snd_ctl_elem_value *value); 30 struct snd_ctl_elem_value *value);
29int xonar_gpio_bit_switch_put(struct snd_kcontrol *ctl, 31int xonar_gpio_bit_switch_put(struct snd_kcontrol *ctl,
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;
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c
index fe4b2655a252..3850834f989c 100644
--- a/sound/pci/oxygen/xonar_pcm179x.c
+++ b/sound/pci/oxygen/xonar_pcm179x.c
@@ -776,6 +776,15 @@ static const struct snd_kcontrol_new os_128_control = {
776 .put = os_128_put, 776 .put = os_128_put,
777}; 777};
778 778
779static const struct snd_kcontrol_new hdav_hdmi_control = {
780 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
781 .name = "HDMI Playback Switch",
782 .info = snd_ctl_boolean_mono_info,
783 .get = xonar_gpio_bit_switch_get,
784 .put = xonar_gpio_bit_switch_put,
785 .private_value = GPIO_HDAV_OUTPUT_ENABLE | XONAR_GPIO_BIT_INVERT,
786};
787
779static int st_output_switch_info(struct snd_kcontrol *ctl, 788static int st_output_switch_info(struct snd_kcontrol *ctl,
780 struct snd_ctl_elem_info *info) 789 struct snd_ctl_elem_info *info)
781{ 790{
@@ -960,7 +969,15 @@ static int xonar_d2_mixer_init(struct oxygen *chip)
960 969
961static int xonar_hdav_mixer_init(struct oxygen *chip) 970static int xonar_hdav_mixer_init(struct oxygen *chip)
962{ 971{
963 return add_pcm1796_controls(chip); 972 int err;
973
974 err = snd_ctl_add(chip->card, snd_ctl_new1(&hdav_hdmi_control, chip));
975 if (err < 0)
976 return err;
977 err = add_pcm1796_controls(chip);
978 if (err < 0)
979 return err;
980 return 0;
964} 981}
965 982
966static int xonar_st_mixer_init(struct oxygen *chip) 983static int xonar_st_mixer_init(struct oxygen *chip)