diff options
Diffstat (limited to 'sound/pci/vx222')
-rw-r--r-- | sound/pci/vx222/vx222_ops.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index c705af409b0f..9b6d345b83a6 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/firmware.h> | 26 | #include <linux/firmware.h> |
27 | #include <linux/mutex.h> | ||
28 | |||
27 | #include <sound/core.h> | 29 | #include <sound/core.h> |
28 | #include <sound/control.h> | 30 | #include <sound/control.h> |
29 | #include <asm/io.h> | 31 | #include <asm/io.h> |
@@ -861,10 +863,10 @@ static int vx_input_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
861 | { | 863 | { |
862 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 864 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
863 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 865 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
864 | down(&_chip->mixer_mutex); | 866 | mutex_lock(&_chip->mixer_mutex); |
865 | ucontrol->value.integer.value[0] = chip->input_level[0]; | 867 | ucontrol->value.integer.value[0] = chip->input_level[0]; |
866 | ucontrol->value.integer.value[1] = chip->input_level[1]; | 868 | ucontrol->value.integer.value[1] = chip->input_level[1]; |
867 | up(&_chip->mixer_mutex); | 869 | mutex_unlock(&_chip->mixer_mutex); |
868 | return 0; | 870 | return 0; |
869 | } | 871 | } |
870 | 872 | ||
@@ -872,16 +874,16 @@ static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
872 | { | 874 | { |
873 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 875 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
874 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 876 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
875 | down(&_chip->mixer_mutex); | 877 | mutex_lock(&_chip->mixer_mutex); |
876 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || | 878 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || |
877 | chip->input_level[1] != ucontrol->value.integer.value[1]) { | 879 | chip->input_level[1] != ucontrol->value.integer.value[1]) { |
878 | chip->input_level[0] = ucontrol->value.integer.value[0]; | 880 | chip->input_level[0] = ucontrol->value.integer.value[0]; |
879 | chip->input_level[1] = ucontrol->value.integer.value[1]; | 881 | chip->input_level[1] = ucontrol->value.integer.value[1]; |
880 | vx2_set_input_level(chip); | 882 | vx2_set_input_level(chip); |
881 | up(&_chip->mixer_mutex); | 883 | mutex_unlock(&_chip->mixer_mutex); |
882 | return 1; | 884 | return 1; |
883 | } | 885 | } |
884 | up(&_chip->mixer_mutex); | 886 | mutex_unlock(&_chip->mixer_mutex); |
885 | return 0; | 887 | return 0; |
886 | } | 888 | } |
887 | 889 | ||
@@ -907,14 +909,14 @@ static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
907 | { | 909 | { |
908 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 910 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
909 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 911 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
910 | down(&_chip->mixer_mutex); | 912 | mutex_lock(&_chip->mixer_mutex); |
911 | if (chip->mic_level != ucontrol->value.integer.value[0]) { | 913 | if (chip->mic_level != ucontrol->value.integer.value[0]) { |
912 | chip->mic_level = ucontrol->value.integer.value[0]; | 914 | chip->mic_level = ucontrol->value.integer.value[0]; |
913 | vx2_set_input_level(chip); | 915 | vx2_set_input_level(chip); |
914 | up(&_chip->mixer_mutex); | 916 | mutex_unlock(&_chip->mixer_mutex); |
915 | return 1; | 917 | return 1; |
916 | } | 918 | } |
917 | up(&_chip->mixer_mutex); | 919 | mutex_unlock(&_chip->mixer_mutex); |
918 | return 0; | 920 | return 0; |
919 | } | 921 | } |
920 | 922 | ||