summaryrefslogtreecommitdiff
path: root/sound/firewire/digi00x
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-07-22 06:36:53 +0300
committerTakashi Iwai <tiwai@suse.de>2019-07-22 17:04:57 +0300
commitab75481202d2925a017e4cb5407b0bb49c356de8 (patch)
treeb1e41e5eb7c6c92dca462af08451173e5ba5ffd3 /sound/firewire/digi00x
parentcdefaa44d535a9d555ac4f1925d59ae4d0ef98e8 (diff)
downloadlinux-ab75481202d2925a017e4cb5407b0bb49c356de8.tar.xz
ALSA: firewire-lib: pass data block counter to data block processing layer
This is a preparation for future commit that 'struct amdtp_stream.data_block_count' does not represent the value of data block count for current data block. However, data block count is required for calculation of sequence index in sequence-multiplied data channel. Some of data block processing layer require it; e.g. for AM824 data block. This commit passes data block count to the processing layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/digi00x')
-rw-r--r--sound/firewire/digi00x/amdtp-dot.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/firewire/digi00x/amdtp-dot.c b/sound/firewire/digi00x/amdtp-dot.c
index 45ff73d16074..5c12973c2652 100644
--- a/sound/firewire/digi00x/amdtp-dot.c
+++ b/sound/firewire/digi00x/amdtp-dot.c
@@ -234,7 +234,7 @@ static inline void midi_use_bytes(struct amdtp_stream *s,
}
static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
- unsigned int data_blocks)
+ unsigned int data_blocks, unsigned int data_block_counter)
{
struct amdtp_dot *p = s->protocol;
unsigned int f, port;
@@ -242,7 +242,7 @@ static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
u8 *b;
for (f = 0; f < data_blocks; f++) {
- port = (s->data_block_counter + f) % 8;
+ port = (data_block_counter + f) % 8;
b = (u8 *)&buffer[0];
len = 0;
@@ -330,9 +330,8 @@ void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port,
}
static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
- __be32 *buffer,
- unsigned int data_blocks,
- unsigned int *syt)
+ __be32 *buffer, unsigned int data_blocks,
+ unsigned int data_block_counter, unsigned int *syt)
{
struct snd_pcm_substream *pcm;
unsigned int pcm_frames;
@@ -351,9 +350,8 @@ static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
}
static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
- __be32 *buffer,
- unsigned int data_blocks,
- unsigned int *syt)
+ __be32 *buffer, unsigned int data_blocks,
+ unsigned int data_block_counter, unsigned int *syt)
{
struct snd_pcm_substream *pcm;
unsigned int pcm_frames;
@@ -367,7 +365,7 @@ static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
pcm_frames = 0;
}
- write_midi_messages(s, buffer, data_blocks);
+ write_midi_messages(s, buffer, data_blocks, data_block_counter);
return pcm_frames;
}