diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-07-22 05:36:51 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-07-22 16:04:55 +0200 |
commit | 588f2e2caf6795ca29d50a45ea1e1438274e75e0 (patch) | |
tree | d73ca445224a9c07d1c81ab00a9ddeea87fb036f /sound/firewire/amdtp-am824.c | |
parent | Merge branch 'topic/hda-acomp-base' into for-next (diff) | |
download | linux-588f2e2caf6795ca29d50a45ea1e1438274e75e0.tar.xz linux-588f2e2caf6795ca29d50a45ea1e1438274e75e0.zip |
ALSA: firewire-lib: obsolete ctx_data.tx.first_dbc with CIP_UNALIGHED_DBC flag
Recent firmware for Fireworks board module have a quirk to start
transmission of CIP with non-zero value for its data block counter.
In current implementation of ALSA firewire stack, the quirk is handled
by 'struct amdtp_stream.ctx_data.tx.first_dbc' with value 0x02. However,
the value comes from reverse engineering. It's better to handle this
quirk without the explicit value.
In a process to parse CIP header, the quirk of data block counter
affects decision of sequence index in sequence-multiplexed data channel;
i.e. MIDI conformant data channel. In Fireworks, the index is decided
by the number of data blocks from top of the same CIP, thus the value
of data block counter is useless.
This commit adds CIP_UNALIGHED_DBC flag and obsoletes the explicit
value for this quirk.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-am824.c')
-rw-r--r-- | sound/firewire/amdtp-am824.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/firewire/amdtp-am824.c b/sound/firewire/amdtp-am824.c index fd5d6b8ac557..99c567ded7a3 100644 --- a/sound/firewire/amdtp-am824.c +++ b/sound/firewire/amdtp-am824.c @@ -315,12 +315,16 @@ static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer, unsigned int frames) { struct amdtp_am824 *p = s->protocol; - unsigned int f, port; int len; u8 *b; + int f; for (f = 0; f < frames; f++) { - port = (8 - s->ctx_data.tx.first_dbc + s->data_block_counter + f) % 8; + unsigned int port = f; + + if (!(s->flags & CIP_UNALIGHED_DBC)) + port += s->data_block_counter; + port %= 8; b = (u8 *)&buffer[p->midi_position]; len = b[0] - 0x80; |