diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-08-04 15:21:22 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-08-05 19:57:18 +0200 |
commit | 157a53eef6a016e6938d9fd266b85221fcd4eaa3 (patch) | |
tree | 646ddf6b611456054c9442bc4176194e340e85d6 /sound/firewire/amdtp-stream.c | |
parent | 6261f90bdb0b605ffb158717ec7a03b1753aded5 (diff) | |
download | linux-157a53eef6a016e6938d9fd266b85221fcd4eaa3.tar.bz2 |
ALSA: firewire-lib: add a kernel API to add AMDTP stream into AMDTP domain
This commit adds a kernel API to insert AMDTP stream to list in AMDTP
domain.
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 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 31fc90f76443..fa7989ee4769 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -1160,6 +1160,32 @@ void amdtp_domain_destroy(struct amdtp_domain *d) EXPORT_SYMBOL_GPL(amdtp_domain_destroy); /** + * amdtp_domain_add_stream - register isoc context into the domain. + * @d: the AMDTP domain. + * @s: the AMDTP stream. + * @channel: the isochronous channel on the bus. + * @speed: firewire speed code. + */ +int amdtp_domain_add_stream(struct amdtp_domain *d, struct amdtp_stream *s, + int channel, int speed) +{ + struct amdtp_stream *tmp; + + list_for_each_entry(tmp, &d->streams, list) { + if (s == tmp) + return -EBUSY; + } + + list_add(&s->list, &d->streams); + + s->channel = channel; + s->speed = speed; + + return 0; +} +EXPORT_SYMBOL_GPL(amdtp_domain_add_stream); + +/** * amdtp_domain_stop - stop sending packets for isoc context in the same domain. * @d: the AMDTP domain to which the isoc contexts belong. */ |