aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-19 08:30:53 +0200
committerTakashi Iwai <tiwai@suse.de>2011-08-19 08:30:53 +0200
commit9fcd0ab130579d9742538340edda3225f2b49a3e (patch)
treebdf6c648c51c172d16cd5ce575b19b3443859c9b /sound/usb/mixer.c
parentb55ac2a116e2b0bb2293873c290751cc17099022 (diff)
ALSA: usb-audio - Check the dB-range validity in the later read, too
When the initial check of dB-range failed due to the read error, try to check again at the later read, too. When an invalid dB range is found, remove TLV flags and notify the mixer info change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index cdd19d7fe50..78a5abda679 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -881,8 +881,17 @@ static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1;
} else {
- if (! cval->initialized)
- get_min_max(cval, 0);
+ if (!cval->initialized) {
+ get_min_max(cval, 0);
+ if (cval->initialized && cval->dBmin >= cval->dBmax) {
+ kcontrol->vd[0].access &=
+ ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ |
+ SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK);
+ snd_ctl_notify(cval->mixer->chip->card,
+ SNDRV_CTL_EVENT_MASK_INFO,
+ &kcontrol->id);
+ }
+ }
uinfo->value.integer.min = 0;
uinfo->value.integer.max =
(cval->max - cval->min + cval->res - 1) / cval->res;