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:
+13
-3
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user