Commit 47b87c8e authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: fireface: add protocol-specific operation to allocate isochronous resources

This commit is a part of preparation to perform allocation/release
of isochronous channels in pcm.hw_params/hw_free callbacks.

In ALSA fireface driver, the allocation of isochronous resources is
programmed in each implementation of protocol. This commit adds
protocol-specific operation for the allocation separated from
the operation to begin session.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d8f291b7
...@@ -156,6 +156,10 @@ int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate) ...@@ -156,6 +156,10 @@ int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate)
if (err < 0) if (err < 0)
return err; return err;
err = ff->spec->protocol->allocate_resources(ff, rate);
if (err < 0)
goto error;
err = ff->spec->protocol->begin_session(ff, rate); err = ff->spec->protocol->begin_session(ff, rate);
if (err < 0) if (err < 0)
goto error; goto error;
......
...@@ -113,6 +113,7 @@ struct snd_ff_protocol { ...@@ -113,6 +113,7 @@ struct snd_ff_protocol {
int (*get_clock)(struct snd_ff *ff, unsigned int *rate, int (*get_clock)(struct snd_ff *ff, unsigned int *rate,
enum snd_ff_clock_src *src); enum snd_ff_clock_src *src);
int (*switch_fetching_mode)(struct snd_ff *ff, bool enable); int (*switch_fetching_mode)(struct snd_ff *ff, bool enable);
int (*allocate_resources)(struct snd_ff *ff, unsigned int rate);
int (*begin_session)(struct snd_ff *ff, unsigned int rate); int (*begin_session)(struct snd_ff *ff, unsigned int rate);
void (*finish_session)(struct snd_ff *ff); void (*finish_session)(struct snd_ff *ff);
void (*dump_status)(struct snd_ff *ff, struct snd_info_buffer *buffer); void (*dump_status)(struct snd_ff *ff, struct snd_info_buffer *buffer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment