diff options
Diffstat (limited to 'sound/usb/usbmixer.c')
-rw-r--r-- | sound/usb/usbmixer.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 89c63d073cc6..a49246113e75 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -59,12 +59,13 @@ static const struct rc_config { | |||
59 | u8 offset; | 59 | u8 offset; |
60 | u8 length; | 60 | u8 length; |
61 | u8 packet_length; | 61 | u8 packet_length; |
62 | u8 min_packet_length; /* minimum accepted length of the URB result */ | ||
62 | u8 mute_mixer_id; | 63 | u8 mute_mixer_id; |
63 | u32 mute_code; | 64 | u32 mute_code; |
64 | } rc_configs[] = { | 65 | } rc_configs[] = { |
65 | { USB_ID(0x041e, 0x3000), 0, 1, 2, 18, 0x0013 }, /* Extigy */ | 66 | { USB_ID(0x041e, 0x3000), 0, 1, 2, 1, 18, 0x0013 }, /* Extigy */ |
66 | { USB_ID(0x041e, 0x3020), 2, 1, 6, 18, 0x0013 }, /* Audigy 2 NX */ | 67 | { USB_ID(0x041e, 0x3020), 2, 1, 6, 6, 18, 0x0013 }, /* Audigy 2 NX */ |
67 | { USB_ID(0x041e, 0x3040), 2, 2, 6, 2, 0x6e91 }, /* Live! 24-bit */ | 68 | { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */ |
68 | }; | 69 | }; |
69 | 70 | ||
70 | struct usb_mixer_interface { | 71 | struct usb_mixer_interface { |
@@ -1388,7 +1389,8 @@ static int mixer_ctl_selector_info(struct snd_kcontrol *kcontrol, struct snd_ctl | |||
1388 | struct usb_mixer_elem_info *cval = kcontrol->private_data; | 1389 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1389 | char **itemlist = (char **)kcontrol->private_value; | 1390 | char **itemlist = (char **)kcontrol->private_value; |
1390 | 1391 | ||
1391 | snd_assert(itemlist, return -EINVAL); | 1392 | if (snd_BUG_ON(!itemlist)) |
1393 | return -EINVAL; | ||
1392 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1394 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1393 | uinfo->count = 1; | 1395 | uinfo->count = 1; |
1394 | uinfo->value.enumerated.items = cval->max; | 1396 | uinfo->value.enumerated.items = cval->max; |
@@ -1781,7 +1783,7 @@ static void snd_usb_soundblaster_remote_complete(struct urb *urb) | |||
1781 | const struct rc_config *rc = mixer->rc_cfg; | 1783 | const struct rc_config *rc = mixer->rc_cfg; |
1782 | u32 code; | 1784 | u32 code; |
1783 | 1785 | ||
1784 | if (urb->status < 0 || urb->actual_length < rc->packet_length) | 1786 | if (urb->status < 0 || urb->actual_length < rc->min_packet_length) |
1785 | return; | 1787 | return; |
1786 | 1788 | ||
1787 | code = mixer->rc_buffer[rc->offset]; | 1789 | code = mixer->rc_buffer[rc->offset]; |
@@ -2012,7 +2014,8 @@ static void snd_audigy2nx_proc_read(struct snd_info_entry *entry, | |||
2012 | } | 2014 | } |
2013 | } | 2015 | } |
2014 | 2016 | ||
2015 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) | 2017 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif, |
2018 | int ignore_error) | ||
2016 | { | 2019 | { |
2017 | static struct snd_device_ops dev_ops = { | 2020 | static struct snd_device_ops dev_ops = { |
2018 | .dev_free = snd_usb_mixer_dev_free | 2021 | .dev_free = snd_usb_mixer_dev_free |
@@ -2027,9 +2030,7 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) | |||
2027 | return -ENOMEM; | 2030 | return -ENOMEM; |
2028 | mixer->chip = chip; | 2031 | mixer->chip = chip; |
2029 | mixer->ctrlif = ctrlif; | 2032 | mixer->ctrlif = ctrlif; |
2030 | #ifdef IGNORE_CTL_ERROR | 2033 | mixer->ignore_ctl_error = ignore_error; |
2031 | mixer->ignore_ctl_error = 1; | ||
2032 | #endif | ||
2033 | mixer->id_elems = kcalloc(256, sizeof(*mixer->id_elems), GFP_KERNEL); | 2034 | mixer->id_elems = kcalloc(256, sizeof(*mixer->id_elems), GFP_KERNEL); |
2034 | if (!mixer->id_elems) { | 2035 | if (!mixer->id_elems) { |
2035 | kfree(mixer); | 2036 | kfree(mixer); |