diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-08-04 09:21:23 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-08-05 20:57:19 +0300 |
commit | 9b4702b06c0e25abc612e6f02f3e25a51c684a01 (patch) | |
tree | 97955b79f0f1455b55d9c31bd611e0b90cfa9120 /sound/firewire/amdtp-stream.c | |
parent | 157a53eef6a016e6938d9fd266b85221fcd4eaa3 (diff) | |
download | linux-9b4702b06c0e25abc612e6f02f3e25a51c684a01.tar.xz |
ALSA: firewire-lib: add a kernel API to start AMDTP streams in AMDTP domain
This commit adds a kernel API to start a couple of isochronous contexts
for some AMDTP streams.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-stream.c')
-rw-r--r-- | sound/firewire/amdtp-stream.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index fa7989ee4769..158d210caea7 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -1186,6 +1186,30 @@ int amdtp_domain_add_stream(struct amdtp_domain *d, struct amdtp_stream *s, EXPORT_SYMBOL_GPL(amdtp_domain_add_stream); /** + * amdtp_domain_start - start sending packets for isoc context in the domain. + * @d: the AMDTP domain. + */ +int amdtp_domain_start(struct amdtp_domain *d) +{ + struct amdtp_stream *s; + int err = 0; + + list_for_each_entry(s, &d->streams, list) { + err = amdtp_stream_start(s, s->channel, s->speed); + if (err < 0) + break; + } + + if (err < 0) { + list_for_each_entry(s, &d->streams, list) + amdtp_stream_stop(s); + } + + return err; +} +EXPORT_SYMBOL_GPL(amdtp_domain_start); + +/** * amdtp_domain_stop - stop sending packets for isoc context in the same domain. * @d: the AMDTP domain to which the isoc contexts belong. */ |