aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 09:45:07 -0400
committerTakashi Iwai <tiwai@suse.de>2014-05-26 08:26:44 -0400
commitb84b1a27b48eb3aea13127f83ec291c614df2992 (patch)
treed779e0cfc2767a4dece6ba47104a88ed23ceb927
parentd9cd0065c8a48dd0ef61acaa9584e3e723249c57 (diff)
ALSA: fireworks/firewire-lib: Add a quirk to reset data block counter at bus reset
Fireworks has a quirk to reset data block counter at bus reset. This commit adds a flag of CIP_SKIP_DBC_ZERO_CHECK. This flag has an effect to skip checking dbc continuity when dbc is zero. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/firewire/amdtp.c4
-rw-r--r--sound/firewire/amdtp.h3
-rw-r--r--sound/firewire/fireworks/fireworks_stream.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 4a7cc1f77d88..5e13b3f15516 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -662,7 +662,9 @@ static void handle_in_packet(struct amdtp_stream *s,
662 662
663 /* Check data block counter continuity */ 663 /* Check data block counter continuity */
664 data_block_counter = cip_header[0] & AMDTP_DBC_MASK; 664 data_block_counter = cip_header[0] & AMDTP_DBC_MASK;
665 if (!(s->flags & CIP_DBC_IS_END_EVENT)) { 665 if ((s->flags & CIP_SKIP_DBC_ZERO_CHECK) && data_block_counter == 0) {
666 lost = false;
667 } else if (!(s->flags & CIP_DBC_IS_END_EVENT)) {
666 lost = data_block_counter != s->data_block_counter; 668 lost = data_block_counter != s->data_block_counter;
667 } else { 669 } else {
668 if ((data_blocks > 0) && (s->tx_dbc_interval > 0)) 670 if ((data_blocks > 0) && (s->tx_dbc_interval > 0))
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index 05f1b8b30e2b..42c75c916684 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -23,6 +23,8 @@
23 * corresponds to the end of event in the packet. Out of IEC 61883. 23 * corresponds to the end of event in the packet. Out of IEC 61883.
24 * @CIP_WRONG_DBS: Only for in-stream. The value of dbs is wrong in in-packets. 24 * @CIP_WRONG_DBS: Only for in-stream. The value of dbs is wrong in in-packets.
25 * The value of data_block_quadlets is used instead of reported value. 25 * The value of data_block_quadlets is used instead of reported value.
26 * @SKIP_DBC_ZERO_CHECK: Only for in-stream. Packets with zero in dbc is
27 * skipped for detecting discontinuity.
26 */ 28 */
27enum cip_flags { 29enum cip_flags {
28 CIP_NONBLOCKING = 0x00, 30 CIP_NONBLOCKING = 0x00,
@@ -31,6 +33,7 @@ enum cip_flags {
31 CIP_EMPTY_WITH_TAG0 = 0x04, 33 CIP_EMPTY_WITH_TAG0 = 0x04,
32 CIP_DBC_IS_END_EVENT = 0x08, 34 CIP_DBC_IS_END_EVENT = 0x08,
33 CIP_WRONG_DBS = 0x10, 35 CIP_WRONG_DBS = 0x10,
36 CIP_SKIP_DBC_ZERO_CHECK = 0x20,
34}; 37};
35 38
36/** 39/**
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c
index c75c2ef2ae31..3a3f203177b1 100644
--- a/sound/firewire/fireworks/fireworks_stream.c
+++ b/sound/firewire/fireworks/fireworks_stream.c
@@ -198,6 +198,8 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
198 efw->tx_stream.flags |= CIP_EMPTY_WITH_TAG0; 198 efw->tx_stream.flags |= CIP_EMPTY_WITH_TAG0;
199 /* Fireworks has its own meaning for dbc. */ 199 /* Fireworks has its own meaning for dbc. */
200 efw->tx_stream.flags |= CIP_DBC_IS_END_EVENT; 200 efw->tx_stream.flags |= CIP_DBC_IS_END_EVENT;
201 /* Fireworks reset dbc at bus reset. */
202 efw->tx_stream.flags |= CIP_SKIP_DBC_ZERO_CHECK;
201 /* AudioFire9 always reports wrong dbs. */ 203 /* AudioFire9 always reports wrong dbs. */
202 if (efw->is_af9) 204 if (efw->is_af9)
203 efw->tx_stream.flags |= CIP_WRONG_DBS; 205 efw->tx_stream.flags |= CIP_WRONG_DBS;