aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 09:45:03 -0400
committerTakashi Iwai <tiwai@suse.de>2014-05-26 08:24:33 -0400
commit7ab566453fe32d6745a82772a16e9bc34c5403a5 (patch)
tree30732973953135dc33d10b163b3624ef9cb867dd
parent315fd41fe9d43838ab5afd26c58d908d18313d9a (diff)
ALSA: fireworks/firewire-lib: Add a quirk for empty packet with TAG0
Fireworks has a quirk to transmit empty packets with TAG0. This commit adds handling this quirk for full duplex stream synchronization. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/firewire/amdtp.c9
-rw-r--r--sound/firewire/amdtp.h2
-rw-r--r--sound/firewire/fireworks/fireworks_stream.c2
3 files changed, 10 insertions, 3 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 5b8846123474..dce4c6dd3f6d 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -815,7 +815,7 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed)
815 }; 815 };
816 unsigned int header_size; 816 unsigned int header_size;
817 enum dma_data_direction dir; 817 enum dma_data_direction dir;
818 int type, err; 818 int type, tag, err;
819 819
820 mutex_lock(&s->mutex); 820 mutex_lock(&s->mutex);
821 821
@@ -869,9 +869,12 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed)
869 } while (s->packet_index > 0); 869 } while (s->packet_index > 0);
870 870
871 /* NOTE: TAG1 matches CIP. This just affects in stream. */ 871 /* NOTE: TAG1 matches CIP. This just affects in stream. */
872 tag = FW_ISO_CONTEXT_MATCH_TAG1;
873 if (s->flags & CIP_EMPTY_WITH_TAG0)
874 tag |= FW_ISO_CONTEXT_MATCH_TAG0;
875
872 s->callbacked = false; 876 s->callbacked = false;
873 err = fw_iso_context_start(s->context, -1, 0, 877 err = fw_iso_context_start(s->context, -1, 0, tag);
874 FW_ISO_CONTEXT_MATCH_TAG1);
875 if (err < 0) 878 if (err < 0)
876 goto err_context; 879 goto err_context;
877 880
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index 3de34639b1c7..96b96ec812b2 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -18,11 +18,13 @@
18 * the overall sample rate comes out right. 18 * the overall sample rate comes out right.
19 * @CIP_SYNC_TO_DEVICE: In sync to device mode, time stamp in out packets is 19 * @CIP_SYNC_TO_DEVICE: In sync to device mode, time stamp in out packets is
20 * generated by in packets. Defaultly this driver generates timestamp. 20 * generated by in packets. Defaultly this driver generates timestamp.
21 * @CIP_EMPTY_WITH_TAG0: Only for in-stream. Empty in-packets have TAG0.
21 */ 22 */
22enum cip_flags { 23enum cip_flags {
23 CIP_NONBLOCKING = 0x00, 24 CIP_NONBLOCKING = 0x00,
24 CIP_BLOCKING = 0x01, 25 CIP_BLOCKING = 0x01,
25 CIP_SYNC_TO_DEVICE = 0x02, 26 CIP_SYNC_TO_DEVICE = 0x02,
27 CIP_EMPTY_WITH_TAG0 = 0x04,
26}; 28};
27 29
28/** 30/**
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c
index ec62aa65cfae..360e871bf838 100644
--- a/sound/firewire/fireworks/fireworks_stream.c
+++ b/sound/firewire/fireworks/fireworks_stream.c
@@ -194,6 +194,8 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
194 err = init_stream(efw, &efw->tx_stream); 194 err = init_stream(efw, &efw->tx_stream);
195 if (err < 0) 195 if (err < 0)
196 goto end; 196 goto end;
197 /* Fireworks transmits NODATA packets with TAG0. */
198 efw->tx_stream.flags |= CIP_EMPTY_WITH_TAG0;
197 199
198 err = init_stream(efw, &efw->rx_stream); 200 err = init_stream(efw, &efw->rx_stream);
199 if (err < 0) { 201 if (err < 0) {