diff options
Diffstat (limited to 'sound/pcmcia')
-rw-r--r-- | sound/pcmcia/vx/vxp_mixer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/pcmcia/vx/vxp_mixer.c b/sound/pcmcia/vx/vxp_mixer.c index 1eff158b8687..bf9d3b37d6bc 100644 --- a/sound/pcmcia/vx/vxp_mixer.c +++ b/sound/pcmcia/vx/vxp_mixer.c | |||
@@ -53,6 +53,10 @@ static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
53 | { | 53 | { |
54 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 54 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
55 | struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; | 55 | struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; |
56 | unsigned int val = ucontrol->value.integer.value[0]; | ||
57 | |||
58 | if (val > MIC_LEVEL_MAX) | ||
59 | return -EINVAL; | ||
56 | mutex_lock(&_chip->mixer_mutex); | 60 | mutex_lock(&_chip->mixer_mutex); |
57 | if (chip->mic_level != ucontrol->value.integer.value[0]) { | 61 | if (chip->mic_level != ucontrol->value.integer.value[0]) { |
58 | vx_set_mic_level(_chip, ucontrol->value.integer.value[0]); | 62 | vx_set_mic_level(_chip, ucontrol->value.integer.value[0]); |
@@ -94,10 +98,11 @@ static int vx_mic_boost_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
94 | { | 98 | { |
95 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 99 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
96 | struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; | 100 | struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; |
101 | int val = !!ucontrol->value.integer.value[0]; | ||
97 | mutex_lock(&_chip->mixer_mutex); | 102 | mutex_lock(&_chip->mixer_mutex); |
98 | if (chip->mic_level != ucontrol->value.integer.value[0]) { | 103 | if (chip->mic_level != val) { |
99 | vx_set_mic_boost(_chip, ucontrol->value.integer.value[0]); | 104 | vx_set_mic_boost(_chip, val); |
100 | chip->mic_level = ucontrol->value.integer.value[0]; | 105 | chip->mic_level = val; |
101 | mutex_unlock(&_chip->mixer_mutex); | 106 | mutex_unlock(&_chip->mixer_mutex); |
102 | return 1; | 107 | return 1; |
103 | } | 108 | } |