summaryrefslogtreecommitdiff
path: root/sound/firewire/amdtp-stream.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-08-04 09:21:21 +0300
committerTakashi Iwai <tiwai@suse.de>2019-08-05 20:57:17 +0300
commit6261f90bdb0b605ffb158717ec7a03b1753aded5 (patch)
tree04417675b43bbf3bb14b1aa8e2ac6f0c8e54c7fd /sound/firewire/amdtp-stream.c
parent3ec3d7a3ff10692d4f8a2baa0ff18fe10a9b6ad4 (diff)
downloadlinux-6261f90bdb0b605ffb158717ec7a03b1753aded5.tar.xz
ALSA: firewire-lib: add a kernel API to stop a couple of AMDTP streams in AMDTP domain
This commit adds a kernel API to stop a couple of isochronous contexts for AMDTP streams. The API is not protected with any lock primitive. Callers should use this with enough lock against concurrent access. 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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index 02077696fa77..31fc90f76443 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -1158,3 +1158,19 @@ void amdtp_domain_destroy(struct amdtp_domain *d)
WARN_ON(!list_empty(&d->streams));
}
EXPORT_SYMBOL_GPL(amdtp_domain_destroy);
+
+/**
+ * amdtp_domain_stop - stop sending packets for isoc context in the same domain.
+ * @d: the AMDTP domain to which the isoc contexts belong.
+ */
+void amdtp_domain_stop(struct amdtp_domain *d)
+{
+ struct amdtp_stream *s, *next;
+
+ list_for_each_entry_safe(s, next, &d->streams, list) {
+ list_del(&s->list);
+
+ amdtp_stream_stop(s);
+ }
+}
+EXPORT_SYMBOL_GPL(amdtp_domain_stop);