aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 3d70245ab442..4f40ba823163 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1141,9 +1141,6 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1141 len = snd_usb_copy_string_desc(state, nameid, 1141 len = snd_usb_copy_string_desc(state, nameid,
1142 kctl->id.name, sizeof(kctl->id.name)); 1142 kctl->id.name, sizeof(kctl->id.name));
1143 1143
1144 /* get min/max values */
1145 get_min_max_with_quirks(cval, 0, kctl);
1146
1147 switch (control) { 1144 switch (control) {
1148 case UAC_FU_MUTE: 1145 case UAC_FU_MUTE:
1149 case UAC_FU_VOLUME: 1146 case UAC_FU_VOLUME:
@@ -1175,17 +1172,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1175 } 1172 }
1176 append_ctl_name(kctl, control == UAC_FU_MUTE ? 1173 append_ctl_name(kctl, control == UAC_FU_MUTE ?
1177 " Switch" : " Volume"); 1174 " Switch" : " Volume");
1178 if (control == UAC_FU_VOLUME) {
1179 check_mapped_dB(map, cval);
1180 if (cval->dBmin < cval->dBmax || !cval->initialized) {
1181 kctl->tlv.c = snd_usb_mixer_vol_tlv;
1182 kctl->vd[0].access |=
1183 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
1184 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
1185 }
1186 }
1187 break; 1175 break;
1188
1189 default: 1176 default:
1190 if (! len) 1177 if (! len)
1191 strlcpy(kctl->id.name, audio_feature_info[control-1].name, 1178 strlcpy(kctl->id.name, audio_feature_info[control-1].name,
@@ -1193,6 +1180,19 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1193 break; 1180 break;
1194 } 1181 }
1195 1182
1183 /* get min/max values */
1184 get_min_max_with_quirks(cval, 0, kctl);
1185
1186 if (control == UAC_FU_VOLUME) {
1187 check_mapped_dB(map, cval);
1188 if (cval->dBmin < cval->dBmax || !cval->initialized) {
1189 kctl->tlv.c = snd_usb_mixer_vol_tlv;
1190 kctl->vd[0].access |=
1191 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
1192 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
1193 }
1194 }
1195
1196 range = (cval->max - cval->min) / cval->res; 1196 range = (cval->max - cval->min) / cval->res;
1197 /* Are there devices with volume range more than 255? I use a bit more 1197 /* Are there devices with volume range more than 255? I use a bit more
1198 * to be sure. 384 is a resolution magic number found on Logitech 1198 * to be sure. 384 is a resolution magic number found on Logitech