Lines Matching full:ff

2 // ff-protocol-former.c - a part of driver for RME Fireface series
10 #include "ff.h"
73 static int former_get_clock(struct snd_ff *ff, unsigned int *rate, in former_get_clock() argument
80 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in former_get_clock()
89 static int former_switch_fetching_mode(struct snd_ff *ff, bool enable) in former_switch_fetching_mode() argument
98 count = max(count, ff->spec->pcm_playback_channels[i]); in former_switch_fetching_mode()
116 err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, in former_switch_fetching_mode()
123 static void dump_clock_config(struct snd_ff *ff, struct snd_info_buffer *buffer) in dump_clock_config() argument
132 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_clock_config()
161 static void dump_sync_status(struct snd_ff *ff, struct snd_info_buffer *buffer) in dump_sync_status() argument
202 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_sync_status()
259 static void former_dump_status(struct snd_ff *ff, in former_dump_status() argument
262 dump_clock_config(ff, buffer); in former_dump_status()
263 dump_sync_status(ff, buffer); in former_dump_status()
266 static int former_fill_midi_msg(struct snd_ff *ff, in former_fill_midi_msg() argument
270 u8 *buf = (u8 *)ff->msg_buf[port]; in former_fill_midi_msg()
281 ff->msg_buf[port][i] = cpu_to_le32(buf[i]); in former_fill_midi_msg()
282 ff->rx_bytes[port] = len; in former_fill_midi_msg()
296 static int allocate_tx_resources(struct snd_ff *ff) in allocate_tx_resources() argument
303 reg = cpu_to_le32(ff->tx_stream.data_block_quadlets); in allocate_tx_resources()
304 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in allocate_tx_resources()
313 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in allocate_tx_resources()
332 ff->tx_resources.channel = tx_isoc_channel; in allocate_tx_resources()
337 static int ff800_allocate_resources(struct snd_ff *ff, unsigned int rate) in ff800_allocate_resources() argument
344 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
355 err = fw_iso_resources_allocate(&ff->rx_resources, in ff800_allocate_resources()
356 amdtp_stream_get_max_payload(&ff->rx_stream), in ff800_allocate_resources()
357 fw_parent_device(ff->unit)->max_speed); in ff800_allocate_resources()
364 data = ff->rx_stream.data_block_quadlets << 3; in ff800_allocate_resources()
365 data = (data << 8) | ff->rx_resources.channel; in ff800_allocate_resources()
367 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
372 return allocate_tx_resources(ff); in ff800_allocate_resources()
375 static int ff800_begin_session(struct snd_ff *ff, unsigned int rate) in ff800_begin_session() argument
377 unsigned int generation = ff->rx_resources.generation; in ff800_begin_session()
380 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff800_begin_session()
381 int err = fw_iso_resources_update(&ff->rx_resources); in ff800_begin_session()
387 reg |= cpu_to_le32(ff->tx_stream.data_block_quadlets); in ff800_begin_session()
388 if (fw_parent_device(ff->unit)->max_speed == SCODE_800) in ff800_begin_session()
390 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_begin_session()
394 static void ff800_finish_session(struct snd_ff *ff) in ff800_finish_session() argument
399 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_finish_session()
407 static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, in ff800_handle_midi_msg() argument
416 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff800_handle_midi_msg()
441 static int ff400_allocate_resources(struct snd_ff *ff, unsigned int rate) in ff400_allocate_resources() argument
458 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_allocate_resources()
470 ff->tx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
471 err = fw_iso_resources_allocate(&ff->tx_resources, in ff400_allocate_resources()
472 amdtp_stream_get_max_payload(&ff->tx_stream), in ff400_allocate_resources()
473 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
478 ff->rx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
479 err = fw_iso_resources_allocate(&ff->rx_resources, in ff400_allocate_resources()
480 amdtp_stream_get_max_payload(&ff->rx_stream), in ff400_allocate_resources()
481 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
483 fw_iso_resources_free(&ff->tx_resources); in ff400_allocate_resources()
488 static int ff400_begin_session(struct snd_ff *ff, unsigned int rate) in ff400_begin_session() argument
490 unsigned int generation = ff->rx_resources.generation; in ff400_begin_session()
494 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff400_begin_session()
495 err = fw_iso_resources_update(&ff->tx_resources); in ff400_begin_session()
499 err = fw_iso_resources_update(&ff->rx_resources); in ff400_begin_session()
506 reg = cpu_to_le32(((ff->rx_stream.data_block_quadlets << 3) << 8) | in ff400_begin_session()
507 ff->rx_resources.channel); in ff400_begin_session()
508 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
517 (ff->tx_resources.channel << 5) | in ff400_begin_session()
518 (ff->tx_stream.data_block_quadlets)); in ff400_begin_session()
519 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
526 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
530 static void ff400_finish_session(struct snd_ff *ff) in ff400_finish_session() argument
535 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_finish_session()
558 static void ff400_handle_midi_msg(struct snd_ff *ff, unsigned int offset, in ff400_handle_midi_msg() argument
577 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff400_handle_midi_msg()
587 substream = READ_ONCE(ff->tx_midi_substreams[1]); in ff400_handle_midi_msg()