aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-04-28 03:58:43 -0400
committerTakashi Iwai <tiwai@suse.de>2011-04-28 03:58:43 -0400
commit59bb7f0eebe69aa32a5c7917a23a7da1c5667d73 (patch)
tree07148368f34290c5127f106909b1fb2422a3f7fb /sound/usb
parent13eb4ab8ca719c852ae5fbd6e803afa333ad569a (diff)
ALSA: usb-audio - Don't expose broken dB ranges
Some crappy USB-audio devices give broken dB ranges, e.g. both min and max are 0dB. This confuses the volume control that prefers dB expression such as alsactl or PulseAudio. In such a case, it's much better not to expose the broken dB information. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 5e4775716607..c8c28cd75534 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1097,11 +1097,13 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1097 append_ctl_name(kctl, control == UAC_FU_MUTE ? 1097 append_ctl_name(kctl, control == UAC_FU_MUTE ?
1098 " Switch" : " Volume"); 1098 " Switch" : " Volume");
1099 if (control == UAC_FU_VOLUME) { 1099 if (control == UAC_FU_VOLUME) {
1100 kctl->tlv.c = mixer_vol_tlv;
1101 kctl->vd[0].access |=
1102 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
1103 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
1104 check_mapped_dB(map, cval); 1100 check_mapped_dB(map, cval);
1101 if (cval->dBmin < cval->dBmax) {
1102 kctl->tlv.c = mixer_vol_tlv;
1103 kctl->vd[0].access |=
1104 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
1105 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
1106 }
1105 } 1107 }
1106 break; 1108 break;
1107 1109