提交 9fcd0ab1 编写于 作者: T Takashi Iwai

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: NTakashi Iwai <tiwai@suse.de>
上级 b55ac2a1
...@@ -881,8 +881,17 @@ static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_ ...@@ -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.min = 0;
uinfo->value.integer.max = 1; uinfo->value.integer.max = 1;
} else { } else {
if (! cval->initialized) if (!cval->initialized) {
get_min_max(cval, 0); 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.min = 0;
uinfo->value.integer.max = uinfo->value.integer.max =
(cval->max - cval->min + cval->res - 1) / cval->res; (cval->max - cval->min + cval->res - 1) / cval->res;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册