summaryrefslogtreecommitdiff
path: root/sound/firewire/amdtp.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 13:45:06 (GMT)
committerTakashi Iwai <tiwai@suse.de>2014-05-26 12:25:15 (GMT)
commitd9cd0065c8a48dd0ef61acaa9584e3e723249c57 (patch)
tree260330cf0ee4727e58a8a4d08059156254a5e7cf /sound/firewire/amdtp.c
parent697022391e46614184101c59e46c9671598026db (diff)
downloadlinux-d9cd0065c8a48dd0ef61acaa9584e3e723249c57.tar.xz
ALSA: fireworks/firewire-lib: Add a quirk for fixed interval of reported dbc
Fireworks firmware version 5.5 reports fix interval for dbc in each packet. For example, AudioFire4: CIP0 CIP1 Payload 00070000 900484FF 72 00070008 9004A8FF 72 00070008 90FFFFFF 02 00070010 9004D0FF 72 00070018 9004C4FF 72 00070020 9004E8FF 72 00070020 90FFFFFF 02 00070028 900410FE 72 The interval of each dbc should be 16 except for empty packet but it's still 8. This commit adds a flag for this quirk and codes to refer to a fixed value. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp.c')
-rw-r--r--sound/firewire/amdtp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 3903387..4a7cc1f 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -618,7 +618,8 @@ static void handle_in_packet(struct amdtp_stream *s,
__be32 *buffer)
{
u32 cip_header[2];
- unsigned int data_blocks, data_block_quadlets, data_block_counter;
+ unsigned int data_blocks, data_block_quadlets, data_block_counter,
+ dbc_interval;
struct snd_pcm_substream *pcm = NULL;
bool lost;
@@ -661,11 +662,17 @@ static void handle_in_packet(struct amdtp_stream *s,
/* Check data block counter continuity */
data_block_counter = cip_header[0] & AMDTP_DBC_MASK;
- if (!(s->flags & CIP_DBC_IS_END_EVENT))
+ if (!(s->flags & CIP_DBC_IS_END_EVENT)) {
lost = data_block_counter != s->data_block_counter;
- else
+ } else {
+ if ((data_blocks > 0) && (s->tx_dbc_interval > 0))
+ dbc_interval = s->tx_dbc_interval;
+ else
+ dbc_interval = data_blocks;
+
lost = data_block_counter !=
- ((s->data_block_counter + data_blocks) & 0xff);
+ ((s->data_block_counter + dbc_interval) & 0xff);
+ }
if (lost) {
dev_info(&s->unit->device,