diff options
author | Dylan Reid <dgreid@chromium.org> | 2012-09-18 12:49:47 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-09-19 02:07:52 -0400 |
commit | 35ec7aa29833de350f51922736aefe22ebf76c4d (patch) | |
tree | 20509b13b846678dbb8c16277bb0c57c936e735b /sound/usb/pcm.c | |
parent | 715a170563843a1f55ae4c8484bc4732d69d2288 (diff) |
ALSA: usb-audio: Don't require hw_params in endpoint.
Change the interface to configure an endpoint so that it doesn't require
a hw_params struct. This will allow it to be called from prepare
instead of hw_params, configuring it after system resume.
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r-- | sound/usb/pcm.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 786f7a05e9a6..62ab4fd5880a 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -491,14 +491,24 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, | |||
491 | mutex_lock(&subs->stream->chip->shutdown_mutex); | 491 | mutex_lock(&subs->stream->chip->shutdown_mutex); |
492 | /* format changed */ | 492 | /* format changed */ |
493 | stop_endpoints(subs, 0, 0, 0); | 493 | stop_endpoints(subs, 0, 0, 0); |
494 | ret = snd_usb_endpoint_set_params(subs->data_endpoint, hw_params, fmt, | 494 | ret = snd_usb_endpoint_set_params(subs->data_endpoint, |
495 | format, | ||
496 | channels, | ||
497 | subs->period_bytes, | ||
498 | rate, | ||
499 | fmt, | ||
495 | subs->sync_endpoint); | 500 | subs->sync_endpoint); |
496 | if (ret < 0) | 501 | if (ret < 0) |
497 | goto unlock; | 502 | goto unlock; |
498 | 503 | ||
499 | if (subs->sync_endpoint) | 504 | if (subs->sync_endpoint) |
500 | ret = snd_usb_endpoint_set_params(subs->sync_endpoint, | 505 | ret = snd_usb_endpoint_set_params(subs->data_endpoint, |
501 | hw_params, fmt, NULL); | 506 | format, |
507 | channels, | ||
508 | subs->period_bytes, | ||
509 | rate, | ||
510 | fmt, | ||
511 | NULL); | ||
502 | unlock: | 512 | unlock: |
503 | mutex_unlock(&subs->stream->chip->shutdown_mutex); | 513 | mutex_unlock(&subs->stream->chip->shutdown_mutex); |
504 | } | 514 | } |