aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/usb/card.c2
-rw-r--r--sound/usb/card.h1
-rw-r--r--sound/usb/pcm.c10
3 files changed, 10 insertions, 3 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 4a469f0cb6d4..561bb74fd364 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -646,6 +646,8 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
646 list_for_each(p, &chip->pcm_list) { 646 list_for_each(p, &chip->pcm_list) {
647 as = list_entry(p, struct snd_usb_stream, list); 647 as = list_entry(p, struct snd_usb_stream, list);
648 snd_pcm_suspend_all(as->pcm); 648 snd_pcm_suspend_all(as->pcm);
649 as->substream[0].need_setup_ep =
650 as->substream[1].need_setup_ep = true;
649 } 651 }
650 } 652 }
651 } else { 653 } else {
diff --git a/sound/usb/card.h b/sound/usb/card.h
index 6cc883c3567d..afa4f9e9b27a 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -125,6 +125,7 @@ struct snd_usb_substream {
125 struct snd_usb_endpoint *data_endpoint; 125 struct snd_usb_endpoint *data_endpoint;
126 struct snd_usb_endpoint *sync_endpoint; 126 struct snd_usb_endpoint *sync_endpoint;
127 unsigned long flags; 127 unsigned long flags;
128 bool need_setup_ep; /* (re)configure EP at prepare? */
128 129
129 u64 formats; /* format bitmasks (all or'ed) */ 130 u64 formats; /* format bitmasks (all or'ed) */
130 unsigned int num_formats; /* number of supported audio formats (list) */ 131 unsigned int num_formats; /* number of supported audio formats (list) */
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index ae783d40f55a..55e19e1b80ec 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -510,6 +510,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
510 510
511 subs->interface = fmt->iface; 511 subs->interface = fmt->iface;
512 subs->altset_idx = fmt->altset_idx; 512 subs->altset_idx = fmt->altset_idx;
513 subs->need_setup_ep = true;
513 514
514 return 0; 515 return 0;
515} 516}
@@ -568,9 +569,12 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
568 if (ret < 0) 569 if (ret < 0)
569 return ret; 570 return ret;
570 571
571 ret = configure_endpoint(subs); 572 if (subs->need_setup_ep) {
572 if (ret < 0) 573 ret = configure_endpoint(subs);
573 return ret; 574 if (ret < 0)
575 return ret;
576 subs->need_setup_ep = false;
577 }
574 578
575 /* some unit conversions in runtime */ 579 /* some unit conversions in runtime */
576 subs->data_endpoint->maxframesize = 580 subs->data_endpoint->maxframesize =