Lines Matching refs:s
55 int amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate, in amdtp_am824_set_parameters() argument
60 struct amdtp_am824 *p = s->protocol; in amdtp_am824_set_parameters()
65 if (amdtp_stream_running(s)) in amdtp_am824_set_parameters()
75 if (WARN_ON(amdtp_stream_running(s)) || in amdtp_am824_set_parameters()
80 err = amdtp_stream_set_parameters(s, rate, in amdtp_am824_set_parameters()
85 if (s->direction == AMDTP_OUT_STREAM) in amdtp_am824_set_parameters()
86 s->ctx_data.rx.fdf = AMDTP_FDF_AM824 | s->sfc; in amdtp_am824_set_parameters()
112 p->midi_fifo_limit = rate - MIDI_BYTES_PER_SECOND * s->syt_interval + 1; in amdtp_am824_set_parameters()
125 void amdtp_am824_set_pcm_position(struct amdtp_stream *s, unsigned int index, in amdtp_am824_set_pcm_position() argument
128 struct amdtp_am824 *p = s->protocol; in amdtp_am824_set_pcm_position()
141 void amdtp_am824_set_midi_position(struct amdtp_stream *s, in amdtp_am824_set_midi_position() argument
144 struct amdtp_am824 *p = s->protocol; in amdtp_am824_set_midi_position()
150 static void write_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm, in write_pcm_s32() argument
154 struct amdtp_am824 *p = s->protocol; in write_pcm_s32()
162 pcm_buffer_pointer = s->pcm_buffer_pointer + pcm_frames; in write_pcm_s32()
175 buffer += s->data_block_quadlets; in write_pcm_s32()
181 static void read_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm, in read_pcm_s32() argument
185 struct amdtp_am824 *p = s->protocol; in read_pcm_s32()
193 pcm_buffer_pointer = s->pcm_buffer_pointer + pcm_frames; in read_pcm_s32()
205 buffer += s->data_block_quadlets; in read_pcm_s32()
211 static void write_pcm_silence(struct amdtp_stream *s, in write_pcm_silence() argument
214 struct amdtp_am824 *p = s->protocol; in write_pcm_silence()
220 buffer += s->data_block_quadlets; in write_pcm_silence()
230 int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s, in amdtp_am824_add_pcm_hw_constraints() argument
235 err = amdtp_stream_add_pcm_hw_constraints(s, runtime); in amdtp_am824_add_pcm_hw_constraints()
254 void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port, in amdtp_am824_midi_trigger() argument
257 struct amdtp_am824 *p = s->protocol; in amdtp_am824_midi_trigger()
274 static bool midi_ratelimit_per_packet(struct amdtp_stream *s, unsigned int port) in midi_ratelimit_per_packet() argument
276 struct amdtp_am824 *p = s->protocol; in midi_ratelimit_per_packet()
283 used -= MIDI_BYTES_PER_SECOND * s->syt_interval; in midi_ratelimit_per_packet()
290 static void midi_rate_use_one_byte(struct amdtp_stream *s, unsigned int port) in midi_rate_use_one_byte() argument
292 struct amdtp_am824 *p = s->protocol; in midi_rate_use_one_byte()
294 p->midi_fifo_used[port] += amdtp_rate_table[s->sfc]; in midi_rate_use_one_byte()
297 static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer, in write_midi_messages() argument
300 struct amdtp_am824 *p = s->protocol; in write_midi_messages()
309 midi_ratelimit_per_packet(s, port) && in write_midi_messages()
312 midi_rate_use_one_byte(s, port); in write_midi_messages()
321 buffer += s->data_block_quadlets; in write_midi_messages()
325 static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer, in read_midi_messages() argument
328 struct amdtp_am824 *p = s->protocol; in read_midi_messages()
336 if (!(s->flags & CIP_UNALIGHED_DBC)) in read_midi_messages()
345 buffer += s->data_block_quadlets; in read_midi_messages()
349 static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, in process_it_ctx_payloads() argument
354 struct amdtp_am824 *p = s->protocol; in process_it_ctx_payloads()
364 write_pcm_s32(s, pcm, buf, data_blocks, pcm_frames); in process_it_ctx_payloads()
367 write_pcm_silence(s, buf, data_blocks); in process_it_ctx_payloads()
371 write_midi_messages(s, buf, data_blocks, in process_it_ctx_payloads()
379 static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, in process_ir_ctx_payloads() argument
384 struct amdtp_am824 *p = s->protocol; in process_ir_ctx_payloads()
394 read_pcm_s32(s, pcm, buf, data_blocks, pcm_frames); in process_ir_ctx_payloads()
399 read_midi_messages(s, buf, data_blocks, in process_ir_ctx_payloads()
415 int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit, in amdtp_am824_init() argument
425 return amdtp_stream_init(s, unit, dir, flags, CIP_FMT_AM, in amdtp_am824_init()