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.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index cdd19d7fe500..60f65ace7474 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -296,7 +296,7 @@ static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request, int v
296 if (snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), request, 296 if (snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), request,
297 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 297 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
298 validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), 298 validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),
299 buf, val_len, 100) >= val_len) { 299 buf, val_len) >= val_len) {
300 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); 300 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));
301 snd_usb_autosuspend(cval->mixer->chip); 301 snd_usb_autosuspend(cval->mixer->chip);
302 return 0; 302 return 0;
@@ -333,7 +333,7 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int v
333 ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest, 333 ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest,
334 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 334 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
335 validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), 335 validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),
336 buf, size, 1000); 336 buf, size);
337 snd_usb_autosuspend(chip); 337 snd_usb_autosuspend(chip);
338 338
339 if (ret < 0) { 339 if (ret < 0) {
@@ -445,7 +445,7 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
445 usb_sndctrlpipe(chip->dev, 0), request, 445 usb_sndctrlpipe(chip->dev, 0), request,
446 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT, 446 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
447 validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), 447 validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),
448 buf, val_len, 100) >= 0) { 448 buf, val_len) >= 0) {
449 snd_usb_autosuspend(chip); 449 snd_usb_autosuspend(chip);
450 return 0; 450 return 0;
451 } 451 }
@@ -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;
@@ -1250,7 +1259,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
1250 build_feature_ctl(state, _ftr, 0, i, &iterm, unitid, 0); 1259 build_feature_ctl(state, _ftr, 0, i, &iterm, unitid, 0);
1251 } 1260 }
1252 } else { /* UAC_VERSION_2 */ 1261 } else { /* UAC_VERSION_2 */
1253 for (i = 0; i < 30/2; i++) { 1262 for (i = 0; i < ARRAY_SIZE(audio_feature_info); i++) {
1254 unsigned int ch_bits = 0; 1263 unsigned int ch_bits = 0;
1255 unsigned int ch_read_only = 0; 1264 unsigned int ch_read_only = 0;
1256 1265