summaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2011-03-11 13:19:43 +0100
committerTakashi Iwai <tiwai@suse.de>2011-03-11 14:51:51 +0100
commitedf7de31c25ce72f163bf7d1fc0d2711869d073c (patch)
tree4b3b7946c6f97ebf9592d525fd1ce9e07fbb8148 /sound/usb/mixer.c
parentcc99a0861fa1c72335dc91a2e06d0b431911d55e (diff)
downloadop-kernel-dev-edf7de31c25ce72f163bf7d1fc0d2711869d073c.zip
op-kernel-dev-edf7de31c25ce72f163bf7d1fc0d2711869d073c.tar.gz
ALSA: usbaudio: fix suspend/resume
- ESHUTDOWN must be correctly handled - the optional interrupt endpoint's URB must be stopped and restarted Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 675a4f1..09e5934 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2075,8 +2075,9 @@ static void snd_usb_mixer_interrupt(struct urb *urb)
{
struct usb_mixer_interface *mixer = urb->context;
int len = urb->actual_length;
+ int ustatus = urb->status;
- if (urb->status != 0)
+ if (ustatus != 0)
goto requeue;
if (mixer->protocol == UAC_VERSION_1) {
@@ -2117,12 +2118,32 @@ static void snd_usb_mixer_interrupt(struct urb *urb)
}
requeue:
- if (urb->status != -ENOENT && urb->status != -ECONNRESET) {
+ if (ustatus != -ENOENT && ustatus != -ECONNRESET && ustatus != -ESHUTDOWN) {
urb->dev = mixer->chip->dev;
usb_submit_urb(urb, GFP_ATOMIC);
}
}
+/* stop any bus activity of a mixer */
+void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
+{
+ usb_kill_urb(mixer->urb);
+ usb_kill_urb(mixer->rc_urb);
+}
+
+int snd_usb_mixer_activate(struct usb_mixer_interface *mixer)
+{
+ int err;
+
+ if (mixer->urb) {
+ err = usb_submit_urb(mixer->urb, GFP_NOIO);
+ if (err < 0)
+ return err;
+ }
+
+ return 0;
+}
+
/* create the handler for the optional status interrupt endpoint */
static int snd_usb_mixer_status_create(struct usb_mixer_interface *mixer)
{
OpenPOWER on IntegriCloud