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>
This commit is contained in:
@@ -2186,6 +2186,34 @@ void snd_usbmidi_input_start(struct list_head* p)
|
||||
}
|
||||
EXPORT_SYMBOL(snd_usbmidi_input_start);
|
||||
|
||||
/*
|
||||
* Prepare for suspend. Typically called from the USB suspend callback.
|
||||
*/
|
||||
void snd_usbmidi_suspend(struct list_head *p)
|
||||
{
|
||||
struct snd_usb_midi *umidi;
|
||||
|
||||
umidi = list_entry(p, struct snd_usb_midi, list);
|
||||
mutex_lock(&umidi->mutex);
|
||||
snd_usbmidi_input_stop(p);
|
||||
mutex_unlock(&umidi->mutex);
|
||||
}
|
||||
EXPORT_SYMBOL(snd_usbmidi_suspend);
|
||||
|
||||
/*
|
||||
* Resume. Typically called from the USB resume callback.
|
||||
*/
|
||||
void snd_usbmidi_resume(struct list_head *p)
|
||||
{
|
||||
struct snd_usb_midi *umidi;
|
||||
|
||||
umidi = list_entry(p, struct snd_usb_midi, list);
|
||||
mutex_lock(&umidi->mutex);
|
||||
snd_usbmidi_input_start(p);
|
||||
mutex_unlock(&umidi->mutex);
|
||||
}
|
||||
EXPORT_SYMBOL(snd_usbmidi_resume);
|
||||
|
||||
/*
|
||||
* Creates and registers everything needed for a MIDI streaming interface.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user