Lines Matching refs:s
113 int amdtp_dot_set_parameters(struct amdtp_stream *s, unsigned int rate, in amdtp_dot_set_parameters() argument
116 struct amdtp_dot *p = s->protocol; in amdtp_dot_set_parameters()
119 if (amdtp_stream_running(s)) in amdtp_dot_set_parameters()
126 err = amdtp_stream_set_parameters(s, rate, pcm_channels + 1); in amdtp_dot_set_parameters()
130 s->ctx_data.rx.fdf = AMDTP_FDF_AM824 | s->sfc; in amdtp_dot_set_parameters()
140 p->midi_fifo_limit = rate - MIDI_BYTES_PER_SECOND * s->syt_interval + 1; in amdtp_dot_set_parameters()
145 static void write_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm, in write_pcm_s32() argument
149 struct amdtp_dot *p = s->protocol; in write_pcm_s32()
157 pcm_buffer_pointer = s->pcm_buffer_pointer + pcm_frames; in write_pcm_s32()
171 buffer += s->data_block_quadlets; in write_pcm_s32()
177 static void read_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm, in read_pcm_s32() argument
181 struct amdtp_dot *p = s->protocol; in read_pcm_s32()
189 pcm_buffer_pointer = s->pcm_buffer_pointer + pcm_frames; in read_pcm_s32()
202 buffer += s->data_block_quadlets; in read_pcm_s32()
208 static void write_pcm_silence(struct amdtp_stream *s, __be32 *buffer, in write_pcm_silence() argument
211 struct amdtp_dot *p = s->protocol; in write_pcm_silence()
220 buffer += s->data_block_quadlets; in write_pcm_silence()
224 static bool midi_ratelimit_per_packet(struct amdtp_stream *s, unsigned int port) in midi_ratelimit_per_packet() argument
226 struct amdtp_dot *p = s->protocol; in midi_ratelimit_per_packet()
233 used -= MIDI_BYTES_PER_SECOND * s->syt_interval; in midi_ratelimit_per_packet()
240 static inline void midi_use_bytes(struct amdtp_stream *s, in midi_use_bytes() argument
243 struct amdtp_dot *p = s->protocol; in midi_use_bytes()
245 p->midi_fifo_used[port] += amdtp_rate_table[s->sfc] * count; in midi_use_bytes()
248 static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer, in write_midi_messages() argument
251 struct amdtp_dot *p = s->protocol; in write_midi_messages()
262 midi_ratelimit_per_packet(s, port) && in write_midi_messages()
280 midi_use_bytes(s, port, len); in write_midi_messages()
288 buffer += s->data_block_quadlets; in write_midi_messages()
292 static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer, in read_midi_messages() argument
295 struct amdtp_dot *p = s->protocol; in read_midi_messages()
318 buffer += s->data_block_quadlets; in read_midi_messages()
322 int amdtp_dot_add_pcm_hw_constraints(struct amdtp_stream *s, in amdtp_dot_add_pcm_hw_constraints() argument
332 return amdtp_stream_add_pcm_hw_constraints(s, runtime); in amdtp_dot_add_pcm_hw_constraints()
335 void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port, in amdtp_dot_midi_trigger() argument
338 struct amdtp_dot *p = s->protocol; in amdtp_dot_midi_trigger()
344 static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, in process_ir_ctx_payloads() argument
358 read_pcm_s32(s, pcm, buf, data_blocks, pcm_frames); in process_ir_ctx_payloads()
362 read_midi_messages(s, buf, data_blocks); in process_ir_ctx_payloads()
368 static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, in process_it_ctx_payloads() argument
382 write_pcm_s32(s, pcm, buf, data_blocks, pcm_frames); in process_it_ctx_payloads()
385 write_pcm_silence(s, buf, data_blocks); in process_it_ctx_payloads()
388 write_midi_messages(s, buf, data_blocks, in process_it_ctx_payloads()
395 int amdtp_dot_init(struct amdtp_stream *s, struct fw_unit *unit, in amdtp_dot_init() argument
407 return amdtp_stream_init(s, unit, dir, flags, CIP_FMT_AM, in amdtp_dot_init()
411 void amdtp_dot_reset(struct amdtp_stream *s) in amdtp_dot_reset() argument
413 struct amdtp_dot *p = s->protocol; in amdtp_dot_reset()