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>
This commit is contained in:
Dylan Reid
2012-09-18 09:49:47 -07:00
committed by Takashi Iwai
parent 715a170563
commit 35ec7aa298
3 changed files with 35 additions and 17 deletions
+13 -3
View File
@@ -491,14 +491,24 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
mutex_lock(&subs->stream->chip->shutdown_mutex);
/* format changed */
stop_endpoints(subs, 0, 0, 0);
ret = snd_usb_endpoint_set_params(subs->data_endpoint, hw_params, fmt,
ret = snd_usb_endpoint_set_params(subs->data_endpoint,
format,
channels,
subs->period_bytes,
rate,
fmt,
subs->sync_endpoint);
if (ret < 0)
goto unlock;
if (subs->sync_endpoint)
ret = snd_usb_endpoint_set_params(subs->sync_endpoint,
hw_params, fmt, NULL);
ret = snd_usb_endpoint_set_params(subs->data_endpoint,
format,
channels,
subs->period_bytes,
rate,
fmt,
NULL);
unlock:
mutex_unlock(&subs->stream->chip->shutdown_mutex);
}