Skip to content

Commit

Permalink
ALSA: firewire-lib: add a kernel API to start AMDTP streams in AMDTP …
Browse files Browse the repository at this point in the history
…domain

This commit adds a kernel API to start a couple of isochronous contexts
for some AMDTP streams.

Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
takaswie authored and tiwai committed Aug 5, 2019
1 parent 157a53e commit 9b4702b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions sound/firewire/amdtp-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,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.
Expand Down
1 change: 1 addition & 0 deletions sound/firewire/amdtp-stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void amdtp_domain_destroy(struct amdtp_domain *d);
int amdtp_domain_add_stream(struct amdtp_domain *d, struct amdtp_stream *s,
int channel, int speed);

int amdtp_domain_start(struct amdtp_domain *d);
void amdtp_domain_stop(struct amdtp_domain *d);

#endif

0 comments on commit 9b4702b

Please sign in to comment.