summaryrefslogtreecommitdiffstats
path: root/sound/firewire/motu/motu.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-03-22 13:30:20 +0100
committerTakashi Iwai <tiwai@suse.de>2017-03-28 12:33:34 +0200
commit9b2bb4f2f4a213a768a84fa25c14be54844f5bb6 (patch)
treee21d07ea7d4fce43739fd0236b95e41f9e962330 /sound/firewire/motu/motu.c
parentALSA: firewire-motu: handle transactions specific for MOTU FireWire models (diff)
downloadlinux-9b2bb4f2f4a213a768a84fa25c14be54844f5bb6.tar.xz
linux-9b2bb4f2f4a213a768a84fa25c14be54844f5bb6.zip
ALSA: firewire-motu: add stream management functionality
This commit adds a functionality to manage packet streaming for MOTU FireWire series. The streaming is not controlled by CMP, thus against IEC 61883-1. Write transaction to certain addresses start/stop packet streaming. Transactions to 0x'ffff'f000'0b00 results in isochronous channel number for both directions and starting/stopping transmission of packets. The isochronous channel number is represented in 6 bit field, thus units can identify the channels up to 64, as IEEE 1394 bus specification described. Transactions to 0x'ffff'f000'0b10 results in packet format for both directions and transmission speed. When each of data block includes fixed part of data chunks only, corresponding flags stand. When bus reset occurs, the units continue to transmit packets with non-contiguous data block counter. This causes discontinuity detection in packet streaming engine and ALSA PCM applications receives EPIPE from any I/O operation. In this case, typical applications manage to recover corresponding PCM substream. This behaviour is kicked much earlier than callback of bus reset handler by Linux FireWire subsystem, therefore status of packet streaming is not changed in the handler. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu.c')
-rw-r--r--sound/firewire/motu/motu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index db6014c2f16d..9d52238d898e 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -56,6 +56,7 @@ static void motu_free(struct snd_motu *motu)
{
snd_motu_transaction_unregister(motu);
+ snd_motu_stream_destroy_duplex(motu);
fw_unit_put(motu->unit);
mutex_destroy(&motu->mutex);
@@ -92,6 +93,10 @@ static void do_registration(struct work_struct *work)
if (err < 0)
goto error;
+ err = snd_motu_stream_init_duplex(motu);
+ if (err < 0)
+ goto error;
+
err = snd_card_register(motu->card);
if (err < 0)
goto error;