diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2014-09-07 15:45:59 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-08 04:57:14 -0400 |
commit | dd38dc1a9bf780b619ab93b3d7a5e90ebad441f5 (patch) | |
tree | 40e1f0aa6a1ea9499a8e6df20d79df2a78e41922 | |
parent | 49f4b4d15c7c9ff8efbb18d9f8c224d3682da573 (diff) |
ALSA: virtuoso: add one more headphone impedance setting
Add one more option to the "Headphones Impedance" control to synchronize
with recent versions of the Windows driver.
Tested-by: fugazzi® <fugazzi99@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/oxygen/xonar_pcm179x.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c index e02605931669..3c0a679c4539 100644 --- a/sound/pci/oxygen/xonar_pcm179x.c +++ b/sound/pci/oxygen/xonar_pcm179x.c | |||
@@ -795,11 +795,11 @@ static int st_output_switch_put(struct snd_kcontrol *ctl, | |||
795 | static int st_hp_volume_offset_info(struct snd_kcontrol *ctl, | 795 | static int st_hp_volume_offset_info(struct snd_kcontrol *ctl, |
796 | struct snd_ctl_elem_info *info) | 796 | struct snd_ctl_elem_info *info) |
797 | { | 797 | { |
798 | static const char *const names[3] = { | 798 | static const char *const names[4] = { |
799 | "< 64 ohms", "64-300 ohms", "300-600 ohms" | 799 | "< 32 ohms", "32-64 ohms", "64-300 ohms", "300-600 ohms" |
800 | }; | 800 | }; |
801 | 801 | ||
802 | return snd_ctl_enum_info(info, 1, 3, names); | 802 | return snd_ctl_enum_info(info, 1, 4, names); |
803 | } | 803 | } |
804 | 804 | ||
805 | static int st_hp_volume_offset_get(struct snd_kcontrol *ctl, | 805 | static int st_hp_volume_offset_get(struct snd_kcontrol *ctl, |
@@ -809,12 +809,14 @@ static int st_hp_volume_offset_get(struct snd_kcontrol *ctl, | |||
809 | struct xonar_pcm179x *data = chip->model_data; | 809 | struct xonar_pcm179x *data = chip->model_data; |
810 | 810 | ||
811 | mutex_lock(&chip->mutex); | 811 | mutex_lock(&chip->mutex); |
812 | if (data->hp_gain_offset < 2*-6) | 812 | if (data->hp_gain_offset < 2*-12) |
813 | value->value.enumerated.item[0] = 0; | 813 | value->value.enumerated.item[0] = 0; |
814 | else if (data->hp_gain_offset < 0) | 814 | else if (data->hp_gain_offset < 2*-6) |
815 | value->value.enumerated.item[0] = 1; | 815 | value->value.enumerated.item[0] = 1; |
816 | else | 816 | else if (data->hp_gain_offset < 0) |
817 | value->value.enumerated.item[0] = 2; | 817 | value->value.enumerated.item[0] = 2; |
818 | else | ||
819 | value->value.enumerated.item[0] = 3; | ||
818 | mutex_unlock(&chip->mutex); | 820 | mutex_unlock(&chip->mutex); |
819 | return 0; | 821 | return 0; |
820 | } | 822 | } |
@@ -823,13 +825,13 @@ static int st_hp_volume_offset_get(struct snd_kcontrol *ctl, | |||
823 | static int st_hp_volume_offset_put(struct snd_kcontrol *ctl, | 825 | static int st_hp_volume_offset_put(struct snd_kcontrol *ctl, |
824 | struct snd_ctl_elem_value *value) | 826 | struct snd_ctl_elem_value *value) |
825 | { | 827 | { |
826 | static const s8 offsets[] = { 2*-18, 2*-6, 0 }; | 828 | static const s8 offsets[] = { 2*-18, 2*-12, 2*-6, 0 }; |
827 | struct oxygen *chip = ctl->private_data; | 829 | struct oxygen *chip = ctl->private_data; |
828 | struct xonar_pcm179x *data = chip->model_data; | 830 | struct xonar_pcm179x *data = chip->model_data; |
829 | s8 offset; | 831 | s8 offset; |
830 | int changed; | 832 | int changed; |
831 | 833 | ||
832 | if (value->value.enumerated.item[0] > 2) | 834 | if (value->value.enumerated.item[0] > 3) |
833 | return -EINVAL; | 835 | return -EINVAL; |
834 | offset = offsets[value->value.enumerated.item[0]]; | 836 | offset = offsets[value->value.enumerated.item[0]]; |
835 | mutex_lock(&chip->mutex); | 837 | mutex_lock(&chip->mutex); |