Skip to content

Commit

Permalink
ALSA: firewire-lib: pass no syt information to data block processing …
Browse files Browse the repository at this point in the history
…layer

In a previous commit, the variable passed from packet streaming layer
for syt variable is useless. This commit obsoletes it.

In my future work, the syt information is passed to data block processing
layer by another way.

Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
takaswie authored and tiwai committed Jul 22, 2019
1 parent 3baf305 commit 600c801
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 31 deletions.
8 changes: 4 additions & 4 deletions sound/firewire/amdtp-am824.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer,
}

static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct amdtp_am824 *p = s->protocol;
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
Expand All @@ -358,8 +358,8 @@ static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
}

static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct amdtp_am824 *p = s->protocol;
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
Expand Down
5 changes: 2 additions & 3 deletions sound/firewire/amdtp-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ static void out_stream_callback(struct fw_iso_context *context, u32 tstamp,
data_blocks = calculate_data_blocks(s, syt);
buffer = s->buffer.packets[s->packet_index].buffer;
dbc = s->data_block_counter;
pcm_frames = s->process_data_blocks(s, buffer, data_blocks, dbc,
&syt);
pcm_frames = s->process_data_blocks(s, buffer, data_blocks, dbc);

if (s->flags & CIP_DBC_IS_END_EVENT)
dbc = (dbc + data_blocks) & 0xff;
Expand Down Expand Up @@ -782,7 +781,7 @@ static void in_stream_callback(struct fw_iso_context *context, u32 tstamp,
if (err >= 0) {
buffer = s->buffer.packets[s->packet_index].buffer;
pcm_frames = s->process_data_blocks(s, buffer,
data_blocks, dbc, &syt);
data_blocks, dbc);

if (!(s->flags & CIP_DBC_IS_END_EVENT))
dbc = (dbc + data_blocks) & 0xff;
Expand Down
3 changes: 1 addition & 2 deletions sound/firewire/amdtp-stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ typedef unsigned int (*amdtp_stream_process_data_blocks_t)(
struct amdtp_stream *s,
__be32 *buffer,
unsigned int data_blocks,
unsigned int data_block_counter,
unsigned int *syt);
unsigned int data_block_counter);
struct amdtp_stream {
struct fw_unit *unit;
enum cip_flags flags;
Expand Down
8 changes: 4 additions & 4 deletions sound/firewire/digi00x/amdtp-dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +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 data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct snd_pcm_substream *pcm;
unsigned int pcm_frames;
Expand All @@ -350,8 +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 data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct snd_pcm_substream *pcm;
unsigned int pcm_frames;
Expand Down
8 changes: 4 additions & 4 deletions sound/firewire/fireface/amdtp-ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
}

static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
unsigned int pcm_frames;
Expand All @@ -121,8 +121,8 @@ static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
}

static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
unsigned int pcm_frames;
Expand Down
11 changes: 4 additions & 7 deletions sound/firewire/motu/amdtp-motu.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ static void __maybe_unused copy_message(u64 *frames, __be32 *buffer,
}

static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct amdtp_motu *p = s->protocol;
struct snd_pcm_substream *pcm;
Expand Down Expand Up @@ -361,15 +361,12 @@ static void write_sph(struct amdtp_stream *s, __be32 *buffer,
}

static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct amdtp_motu *p = (struct amdtp_motu *)s->protocol;
struct snd_pcm_substream *pcm;

/* Not used. */
*syt = 0xffff;

/* TODO: how to interact control messages between userspace? */

if (p->midi_ports)
Expand Down
11 changes: 4 additions & 7 deletions sound/firewire/tascam/amdtp-tascam.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ static void read_status_messages(struct amdtp_stream *s,
}

static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct snd_pcm_substream *pcm;

Expand All @@ -181,14 +181,11 @@ 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 data_block_counter, unsigned int *syt)
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
{
struct snd_pcm_substream *pcm;

/* This field is not used. */
*syt = 0x0000;

pcm = READ_ONCE(s->pcm);
if (pcm)
write_pcm_s32(s, pcm, buffer, data_blocks);
Expand Down

0 comments on commit 600c801

Please sign in to comment.