aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-19 02:30:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-21 17:31:17 -0500
commit9338f407e30015cd9d236d8a678cacd2c72d4a31 (patch)
tree63afae042fb46368bc5690989a9c956f93008358 /sound
parentf73870d6d33cd24c8fe2a7b39b2f99c433804945 (diff)
ALSA: usb-audio - Check the dB-range validity in the later read, too
commit 9fcd0ab130579d9742538340edda3225f2b49a3e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-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..a033129e973 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_
881 uinfo->value.integer.min = 0; 881 uinfo->value.integer.min = 0;
882 uinfo->value.integer.max = 1; 882 uinfo->value.integer.max = 1;
883 } else { 883 } else {
884 if (! cval->initialized) 884 if (!cval->initialized) {
885 get_min_max(cval, 0); 885 get_min_max(cval, 0);
886 if (cval->initialized && cval->dBmin >= cval->dBmax) {
887 kcontrol->vd[0].access &=
888 ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ |
889 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK);
890 snd_ctl_notify(cval->mixer->chip->card,
891 SNDRV_CTL_EVENT_MASK_INFO,
892 &kcontrol->id);
893 }
894 }
886 uinfo->value.integer.min = 0; 895 uinfo->value.integer.min = 0;
887 uinfo->value.integer.max = 896 uinfo->value.integer.max =
888 (cval->max - cval->min + cval->res - 1) / cval->res; 897 (cval->max - cval->min + cval->res - 1) / cval->res;