Lines Matching refs:ff

141 static int latter_get_clock(struct snd_ff *ff, unsigned int *rate,  in latter_get_clock()  argument
148 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in latter_get_clock()
154 return parse_clock_bits(data, rate, src, ff->unit_version); in latter_get_clock()
157 static int latter_switch_fetching_mode(struct snd_ff *ff, bool enable) in latter_switch_fetching_mode() argument
168 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_switch_fetching_mode()
172 static int latter_allocate_resources(struct snd_ff *ff, unsigned int rate) in latter_allocate_resources() argument
197 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_allocate_resources()
208 err = latter_get_clock(ff, &curr_rate, &src); in latter_allocate_resources()
230 ff->tx_resources.channels_mask = 0x00000000000000ffuLL; in latter_allocate_resources()
231 err = fw_iso_resources_allocate(&ff->tx_resources, in latter_allocate_resources()
232 amdtp_stream_get_max_payload(&ff->tx_stream), in latter_allocate_resources()
233 fw_parent_device(ff->unit)->max_speed); in latter_allocate_resources()
238 ff->rx_resources.channels_mask = 0x00000000000000ffuLL; in latter_allocate_resources()
239 err = fw_iso_resources_allocate(&ff->rx_resources, in latter_allocate_resources()
240 amdtp_stream_get_max_payload(&ff->rx_stream), in latter_allocate_resources()
241 fw_parent_device(ff->unit)->max_speed); in latter_allocate_resources()
243 fw_iso_resources_free(&ff->tx_resources); in latter_allocate_resources()
248 static int latter_begin_session(struct snd_ff *ff, unsigned int rate) in latter_begin_session() argument
250 unsigned int generation = ff->rx_resources.generation; in latter_begin_session()
256 if (ff->unit_version == SND_FF_UNIT_VERSION_UCX) { in latter_begin_session()
281 if (generation != fw_parent_device(ff->unit)->card->generation) { in latter_begin_session()
282 err = fw_iso_resources_update(&ff->tx_resources); in latter_begin_session()
286 err = fw_iso_resources_update(&ff->rx_resources); in latter_begin_session()
291 data = (ff->tx_resources.channel << 8) | ff->rx_resources.channel; in latter_begin_session()
293 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_begin_session()
299 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_begin_session()
303 static void latter_finish_session(struct snd_ff *ff) in latter_finish_session() argument
308 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_finish_session()
312 static void latter_dump_status(struct snd_ff *ff, struct snd_info_buffer *buffer) in latter_dump_status() argument
337 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in latter_dump_status()
345 if (ff->unit_version == SND_FF_UNIT_VERSION_UCX) { in latter_dump_status()
366 err = parse_clock_bits(data, &rate, &src, ff->unit_version); in latter_dump_status()
396 static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, in latter_handle_midi_msg() argument
405 if (index >= ff->spec->midi_in_ports) in latter_handle_midi_msg()
431 substream = READ_ONCE(ff->tx_midi_substreams[index]); in latter_handle_midi_msg()
486 static int latter_fill_midi_msg(struct snd_ff *ff, in latter_fill_midi_msg() argument
499 if (!ff->on_sysex[port]) { in latter_fill_midi_msg()
505 ff->on_sysex[port] = true; in latter_fill_midi_msg()
519 ff->on_sysex[port] = false; in latter_fill_midi_msg()
525 ff->msg_buf[port][0] = cpu_to_le32(data); in latter_fill_midi_msg()
526 ff->rx_bytes[port] = consumed; in latter_fill_midi_msg()