Commit 38b65190 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio - Fix missing mixer dB information

The recent fix for testing dB range at the mixer creation time seems
to cause regressions in some devices.  In such devices, reading the dB
info at probing time gives an error, thus both dBmin and dBmax are still
zero, and TLV flag isn't set although the later read of dB info succeeds.

This patch adds a workaround for such a case by assuming that the later
read will succeed.  In future, a similar test should be performed in a
case where a wrong dB range is seen even in the later read.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
parent 3fe45aea
...@@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, ...@@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p,
if (p && p->dB) { if (p && p->dB) {
cval->dBmin = p->dB->min; cval->dBmin = p->dB->min;
cval->dBmax = p->dB->max; cval->dBmax = p->dB->max;
cval->initialized = 1;
} }
} }
...@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, ...@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
" Switch" : " Volume"); " Switch" : " Volume");
if (control == UAC_FU_VOLUME) { if (control == UAC_FU_VOLUME) {
check_mapped_dB(map, cval); check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax) { if (cval->dBmin < cval->dBmax || !cval->initialized) {
kctl->tlv.c = mixer_vol_tlv; kctl->tlv.c = mixer_vol_tlv;
kctl->vd[0].access |= kctl->vd[0].access |=
SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_TLV_READ |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment