diff options
author | Adam Goode <agoode@google.com> | 2014-08-05 12:44:50 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-08-05 20:08:00 +0200 |
commit | f7881e5e8ef305e62084bf3d31b5b0d827fdf511 (patch) | |
tree | 8b9c547475e928678582f6892286310f3a53abe0 /sound/usb/card.c | |
parent | 81cb6b6be54d160ac8feb61f1510f33a3cece1d3 (diff) | |
download | op-kernel-dev-f7881e5e8ef305e62084bf3d31b5b0d827fdf511.zip op-kernel-dev-f7881e5e8ef305e62084bf3d31b5b0d827fdf511.tar.gz |
ALSA: usb-audio: Respond to suspend and resume callbacks for MIDI input
sound/usb/card.c registers USB suspend and resume but did not previously
kill the input URBs. This means that USB MIDI devices left open across
suspend/resume had non-functional input (output still usually worked,
but it looks like that is another issue). Before this change, we would
get ESHUTDOWN for each of the input URBs at suspend time, killing input.
Signed-off-by: Adam Goode <agoode@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r-- | sound/usb/card.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index a09e5f3..7ecd0e8 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -680,6 +680,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) struct snd_usb_audio *chip = usb_get_intfdata(intf); struct snd_usb_stream *as; struct usb_mixer_interface *mixer; + struct list_head *p; if (chip == (void *)-1L) return 0; @@ -692,6 +693,9 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) as->substream[0].need_setup_ep = as->substream[1].need_setup_ep = true; } + list_for_each(p, &chip->midi_list) { + snd_usbmidi_suspend(p); + } } } else { /* @@ -713,6 +717,7 @@ static int __usb_audio_resume(struct usb_interface *intf, bool reset_resume) { struct snd_usb_audio *chip = usb_get_intfdata(intf); struct usb_mixer_interface *mixer; + struct list_head *p; int err = 0; if (chip == (void *)-1L) @@ -731,6 +736,10 @@ static int __usb_audio_resume(struct usb_interface *intf, bool reset_resume) goto err_out; } + list_for_each(p, &chip->midi_list) { + snd_usbmidi_resume(p); + } + if (!chip->autosuspended) snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0); chip->autosuspended = 0; |