Lines Matching refs:ff

71 static int former_get_clock(struct snd_ff *ff, unsigned int *rate,  in former_get_clock()  argument
78 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in former_get_clock()
87 static int former_switch_fetching_mode(struct snd_ff *ff, bool enable) in former_switch_fetching_mode() argument
96 count = max(count, ff->spec->pcm_playback_channels[i]); in former_switch_fetching_mode()
114 err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, in former_switch_fetching_mode()
121 static void dump_clock_config(struct snd_ff *ff, struct snd_info_buffer *buffer) in dump_clock_config() argument
130 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_clock_config()
159 static void dump_sync_status(struct snd_ff *ff, struct snd_info_buffer *buffer) in dump_sync_status() argument
200 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_sync_status()
257 static void former_dump_status(struct snd_ff *ff, in former_dump_status() argument
260 dump_clock_config(ff, buffer); in former_dump_status()
261 dump_sync_status(ff, buffer); in former_dump_status()
264 static int former_fill_midi_msg(struct snd_ff *ff, in former_fill_midi_msg() argument
268 u8 *buf = (u8 *)ff->msg_buf[port]; in former_fill_midi_msg()
279 ff->msg_buf[port][i] = cpu_to_le32(buf[i]); in former_fill_midi_msg()
280 ff->rx_bytes[port] = len; in former_fill_midi_msg()
294 static int allocate_tx_resources(struct snd_ff *ff) in allocate_tx_resources() argument
301 reg = cpu_to_le32(ff->tx_stream.data_block_quadlets); in allocate_tx_resources()
302 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in allocate_tx_resources()
311 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in allocate_tx_resources()
330 ff->tx_resources.channel = tx_isoc_channel; in allocate_tx_resources()
335 static int ff800_allocate_resources(struct snd_ff *ff, unsigned int rate) in ff800_allocate_resources() argument
342 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
353 err = fw_iso_resources_allocate(&ff->rx_resources, in ff800_allocate_resources()
354 amdtp_stream_get_max_payload(&ff->rx_stream), in ff800_allocate_resources()
355 fw_parent_device(ff->unit)->max_speed); in ff800_allocate_resources()
362 data = ff->rx_stream.data_block_quadlets << 3; in ff800_allocate_resources()
363 data = (data << 8) | ff->rx_resources.channel; in ff800_allocate_resources()
365 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
370 return allocate_tx_resources(ff); in ff800_allocate_resources()
373 static int ff800_begin_session(struct snd_ff *ff, unsigned int rate) in ff800_begin_session() argument
375 unsigned int generation = ff->rx_resources.generation; in ff800_begin_session()
378 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff800_begin_session()
379 int err = fw_iso_resources_update(&ff->rx_resources); in ff800_begin_session()
385 reg |= cpu_to_le32(ff->tx_stream.data_block_quadlets); in ff800_begin_session()
386 if (fw_parent_device(ff->unit)->max_speed == SCODE_800) in ff800_begin_session()
388 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_begin_session()
392 static void ff800_finish_session(struct snd_ff *ff) in ff800_finish_session() argument
397 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_finish_session()
405 static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, in ff800_handle_midi_msg() argument
414 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff800_handle_midi_msg()
439 static int ff400_allocate_resources(struct snd_ff *ff, unsigned int rate) in ff400_allocate_resources() argument
456 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_allocate_resources()
468 ff->tx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
469 err = fw_iso_resources_allocate(&ff->tx_resources, in ff400_allocate_resources()
470 amdtp_stream_get_max_payload(&ff->tx_stream), in ff400_allocate_resources()
471 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
476 ff->rx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
477 err = fw_iso_resources_allocate(&ff->rx_resources, in ff400_allocate_resources()
478 amdtp_stream_get_max_payload(&ff->rx_stream), in ff400_allocate_resources()
479 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
481 fw_iso_resources_free(&ff->tx_resources); in ff400_allocate_resources()
486 static int ff400_begin_session(struct snd_ff *ff, unsigned int rate) in ff400_begin_session() argument
488 unsigned int generation = ff->rx_resources.generation; in ff400_begin_session()
492 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff400_begin_session()
493 err = fw_iso_resources_update(&ff->tx_resources); in ff400_begin_session()
497 err = fw_iso_resources_update(&ff->rx_resources); in ff400_begin_session()
504 reg = cpu_to_le32(((ff->rx_stream.data_block_quadlets << 3) << 8) | in ff400_begin_session()
505 ff->rx_resources.channel); in ff400_begin_session()
506 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
515 (ff->tx_resources.channel << 5) | in ff400_begin_session()
516 (ff->tx_stream.data_block_quadlets)); in ff400_begin_session()
517 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
524 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
528 static void ff400_finish_session(struct snd_ff *ff) in ff400_finish_session() argument
533 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_finish_session()
537 static void parse_midi_msg(struct snd_ff *ff, u32 quad, unsigned int port) in parse_midi_msg() argument
539 struct snd_rawmidi_substream *substream = READ_ONCE(ff->tx_midi_substreams[port]); in parse_midi_msg()
559 static bool ff400_has_msg(struct snd_ff *ff) in ff400_has_msg() argument
561 struct ff400_msg_parser *parser = ff->msg_parser; in ff400_has_msg()
648 static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, in ff400_handle_msg() argument
658 struct ff400_msg_parser *parser = ff->msg_parser; in ff400_handle_msg()
668 parse_midi_msg(ff, quad, 0); in ff400_handle_msg()
670 parse_midi_msg(ff, quad, 1); in ff400_handle_msg()
675 wake_up(&ff->hwdep_wait); in ff400_handle_msg()
678 static long ff400_copy_msg_to_user(struct snd_ff *ff, char __user *buf, long count) in ff400_copy_msg_to_user() argument
684 struct ff400_msg_parser *parser = ff->msg_parser; in ff400_copy_msg_to_user()
695 spin_unlock_irq(&ff->lock); in ff400_copy_msg_to_user()
699 spin_lock_irq(&ff->lock); in ff400_copy_msg_to_user()
711 spin_unlock_irq(&ff->lock); in ff400_copy_msg_to_user()
714 spin_lock_irq(&ff->lock); in ff400_copy_msg_to_user()